Skip to content

Fall back to embedded build info for version vars - #55

Merged
andrew merged 1 commit into
mainfrom
version-buildinfo-fallback
Sep 16, 2026
Merged

andrew merged 1 commit into
mainfrom
version-buildinfo-fallback

Conversation

@andrew

@andrew andrew commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

go install github.com/git-pkgs/pin/cmd/pin@<tag> builds without goreleaser's -ldflags -X, so pin --version reports dev and lockfiles record pin@dev as the tool. Read debug.ReadBuildInfo().Main.Version when either var is at its default so go install users see the tag they installed. The ldflags still win for release builds.

go install does not apply goreleaser's -ldflags -X, so binaries
installed that way reported 'dev'. Read debug.BuildInfo.Main.Version
when the ldflag is unset, in both places goreleaser targets.
@andrew
andrew merged commit 3631228 into main Sep 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant