Skip to content

fix: cdd version said dev (dev) for go install builds - #52

Merged
hammadmajid merged 2 commits into
mainfrom
fix/version-buildinfo
Sep 17, 2026
Merged

hammadmajid merged 2 commits into
mainfrom
fix/version-buildinfo

Conversation

@hammadmajid

Copy link
Copy Markdown
Contributor

go install github.com/kryft-dev/cdd/cmd/cdd@v0.1.1 printed cdd dev (dev) because go install never passes GoReleaser's ldflags, so the three version variables kept their defaults.

  • fix(cli): when ldflags are absent, read debug.ReadBuildInfo(). A tagged module install reports cdd 0.1.1 (go install). A build from a checkout reports cdd dev (b72f011 2026-09-17), with +dirty when the tree was modified. Only a binary with no build info at all still says cdd dev (dev).
  • test(cli): table test over all five cases via a pure formatVersion.

GoReleaser binaries are unchanged: ldflags still win.

🤖 Generated with Claude Code

hammadmajid and others added 2 commits September 17, 2026 12:31
go install builds never receive GoReleaser's ldflags, so every module
install said "cdd dev (dev)". Fall back to the module version Go embeds,
then to the VCS revision for checkout builds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…, and unknown builds

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@hammadmajid
hammadmajid merged commit 38f1e78 into main Sep 17, 2026
3 checks passed
@hammadmajid
hammadmajid deleted the fix/version-buildinfo branch September 17, 2026 07: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