• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kcl-lang / cli / 31017517112
28%
main: 28%

Build:
Build:
LAST BUILD BRANCH: fix/version-printing-issue-363
DEFAULT BRANCH: main
Ran 05 Aug 2026 02:59PM UTC
Jobs 1
Files 11
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Aug 2026 02:53PM UTC coverage: 27.691% (+0.3%) from 27.386%
31017517112

Pull #364

github

claude
feat(version): fall back to debug.ReadBuildInfo when LDFLAGS is missing

Adds a secondary fallback so binaries built without the
`-ldflags "-X .../pkg/version.version=..."` injection still report a
useful version instead of silently displaying the hardcoded
VersionTypeLatest constant.

The lookup order is now:

  1. LDFLAGS-injected `version` variable (used by goreleaser and the
     musl release build).
  2. `debug.ReadBuildInfo().Main.Version` from the Go runtime (works
     for `go install kcl-lang.io/cli@vX.Y.Z` and similar module-aware
     builds). The leading "v" is stripped and "(devel)" / pseudo-versions
     are treated as "no version available" so the fallback can still
     kick in.
  3. Hardcoded `VersionTypeLatest` constant.

A new test asserts that the build info path returns the empty string
under `go test` (where the main module is reported as "(devel)").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pull Request #364: fix(cli): ensure version is correctly embedded in all release binaries

10 of 16 new or added lines in 1 file covered. (62.5%)

7 existing lines in 1 file now uncovered.

247 of 892 relevant lines covered (27.69%)

0.3 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
70.83
-20.83% pkg/version/version.go

Coverage Regressions

Lines Coverage ∆ File
7
70.83
-20.83% pkg/version/version.go
Jobs
ID Job ID Ran Files Coverage
1 31017517112.1 05 Aug 2026 02:59PM UTC 11
27.69
GitHub Action Run
Source Files on build 31017517112
  • Tree
  • List 11
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #364
  • PR Base - main (#30545958869)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc