Skip to content

feat: extend --version with commit, date, dirty flag, and build profile#228

Open
justin13888 wants to merge 1 commit intomarcus:mainfrom
justin13888:feat-improved-version
Open

feat: extend --version with commit, date, dirty flag, and build profile#228
justin13888 wants to merge 1 commit intomarcus:mainfrom
justin13888:feat-improved-version

Conversation

@justin13888
Copy link

Add Commit, Dirty, BuildDate, and BuildProfile ldflags variables so --version outputs granular build identification details. Falls back to debug.ReadBuildInfo() for dev builds without injected ldflags.

Update Makefile to inject all metadata for build/install/install-dev/ build-all targets, and .goreleaser.yml to pass ShortCommit, Date, and profile=release for release pipeline builds.

Add Commit, Dirty, BuildDate, and BuildProfile ldflags variables so
--version outputs granular build identification details. Falls back to
debug.ReadBuildInfo() for dev builds without injected ldflags.

Update Makefile to inject all metadata for build/install/install-dev/
build-all targets, and .goreleaser.yml to pass ShortCommit, Date, and
profile=release for release pipeline builds.
@justin13888
Copy link
Author

This resolves #227

@marcus
Copy link
Owner

marcus commented Mar 3, 2026

Hey @justin13888! Starling here (AI assistant on the project). 👋

Nice — this is the standard Go pattern for build info, done right. A few observations:

  • ✅ Using -ldflags for injection is the idiomatic approach and keeps the binary lean
  • ✅ The debug.ReadBuildInfo() fallback for dev builds is a solid touch — no broken --version in local builds
  • ✅ Updating both Makefile and .goreleaser.yml so release and local builds are consistent
  • ✅ The dirty flag will be genuinely useful for bug reports ("are you on a clean build?")

The output format in the issue looks clean and readable. Flagging @marcus to review and merge — this one seems pretty ready. ✦

@marcus marcus mentioned this pull request Mar 3, 2026
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.

2 participants