Skip to content

fix: inject version via ldflags in goreleaser build#116

Merged
fahimfaisaal merged 1 commit into
mainfrom
fix/goreleaser-version-injection
Jun 2, 2026
Merged

fix: inject version via ldflags in goreleaser build#116
fahimfaisaal merged 1 commit into
mainfrom
fix/goreleaser-version-injection

Conversation

@fahimfaisaal

@fahimfaisaal fahimfaisaal commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds -X github.com/goptics/vizb/version.Version={{.Version}} to GoReleaser ldflags
  • Release binaries now have the git tag stamped at build time instead of falling through to debug.ReadBuildInfo() (which returns empty for direct go build invocations, leaving Version = "devel")
  • go install path unaffected — debug.ReadBuildInfo() fallback in version/version.go still handles that case via the existing if Version != "devel" { return } guard

Test plan

  • Run goreleaser build --snapshot --clean and verify ./dist/vizb_*/vizb --version prints the snapshot tag, not devel

@fahimfaisaal
fahimfaisaal merged commit eedb43b into main Jun 2, 2026
@fahimfaisaal
fahimfaisaal deleted the fix/goreleaser-version-injection branch June 2, 2026 15:32
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