Skip to content

feat: enrich --version output with Go runtime and platform info#5

Closed
Congregalis wants to merge 1 commit intomainfrom
feat/issue-2-version-runtime-output
Closed

feat: enrich --version output with Go runtime and platform info#5
Congregalis wants to merge 1 commit intomainfrom
feat/issue-2-version-runtime-output

Conversation

@Congregalis
Copy link
Owner

Summary

  • Extend version.String() to include go, os, and arch fields
  • Keep existing Version/Commit/BuildTime ldflags injection points unchanged
  • Add a dedicated unit test for version.String()
  • Update CLI version-output test expectation to match the new format

Closes #2

Validation

  • go test ./internal/version ./internal/cli -run 'TestStringIncludesGoRuntimeAndPlatform|TestRunVersionSkipsAPIKeyRequirement'
  • go build -ldflags "-X transblog/internal/version.Version=v9.9.9 -X transblog/internal/version.Commit=$(git rev-parse --short HEAD) -X transblog/internal/version.BuildTime=2026-03-12T15:40:00Z" -o /tmp/transblog-issue2-bin ./cmd/transblog
  • /tmp/transblog-issue2-bin --version

Copy link
Owner Author

@Congregalis Congregalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 PR 本身改动 OK(同 #6):版本输出补 go/os/arch + 测试齐。

但目前 PR #5 与 PR #6 内容完全重复(diff 一样)。为了减少重复与后续维护成本,建议关闭本 PR,保留另一个(比如 #6)合并即可。

@Congregalis
Copy link
Owner Author

Closing in favor of #6 (same diff).

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.

Enhancement: output should include Go version and runtime OS/arch

1 participant