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

kcl-lang / cli
28%
main: 28%

Build:
Build:
LAST BUILD BRANCH: fix/version-printing-issue-363
DEFAULT BRANCH: main
Repo Added 24 Oct 2023 03:12AM UTC
Token NzC29UHkLY3mkLSUgvV1Sya7e9PwEbHuL regen
Build 960 Last
Files 11
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

LAST BUILD ON BRANCH fix/version-printing-issue-363
branch: fix/version-printing-issue-363
CHANGE BRANCH
x
Reset
Sync Branches
  • fix/version-printing-issue-363
  • add-brew-and-scoop-template
  • add-ca-certificates-in-image
  • add-e2e-tests
  • add-kcl-lsp-release-using-hook
  • add-mod-spec
  • add-mod-update
  • add-run-entry-for-test
  • add-single-module-folder-with-kcl-mod-run-kind
  • bug/tini-arm64
  • bump-kcl-0.7
  • bump-kcl-080-stable
  • bump-kcl-090-beta
  • bump-kcl-go-090-latest
  • bump-kcl-go-version-to075
  • bump-kcl-version-0.7.0-alpha.2
  • bump-kpm-kcl-go-0.10.x-alpha
  • bump-kpm-version
  • bump-release-image
  • bump-version
  • bump-version-0.11.2
  • bump_go_124
  • bump_purego
  • chore-adjust-ci-test
  • chore-bump-kcl-0.12.2-with-musl
  • chore-bump-kcl-0.12.3
  • chore-bump-kcl-086
  • chore-bump-kcl-go-and-kpm-to-0.10.0-beta.2
  • chore-bump-kcl-go-version
  • chore-bump-kcl-openapi-version-and-keep-order
  • chore-bump-kcl-version-0.10.3
  • chore-bump-lib-085
  • chore-update-image-e2e-test-tag
  • chore-update-kcl-and-kcl-openapi-version
  • chore-update-version-to-0.11.1
  • ci-concurrent-test
  • ci-image-test
  • delete_helpmsg_path
  • dependabot/github_actions/actions/checkout-4
  • dependabot/github_actions/actions/checkout-5
  • dependabot/github_actions/actions/checkout-6
  • dependabot/github_actions/actions/checkout-7
  • dependabot/github_actions/actions/download-artifact-6
  • dependabot/github_actions/actions/download-artifact-7
  • dependabot/github_actions/actions/setup-go-5
  • dependabot/github_actions/actions/setup-go-6
  • dependabot/github_actions/actions/setup-go-7
  • dependabot/github_actions/actions/upload-artifact-5
  • dependabot/github_actions/actions/upload-artifact-6
  • dependabot/github_actions/contributor-assistant/github-action-2.3.1
  • dependabot/github_actions/contributor-assistant/github-action-2.3.2
  • dependabot/github_actions/contributor-assistant/github-action-2.4.0
  • dependabot/github_actions/docker/build-push-action-5
  • dependabot/github_actions/docker/build-push-action-6
  • dependabot/github_actions/docker/build-push-action-7
  • dependabot/github_actions/docker/login-action-3
  • dependabot/github_actions/docker/login-action-3.4.0
  • dependabot/github_actions/docker/login-action-3.5.0
  • dependabot/github_actions/docker/login-action-3.6.0
  • dependabot/github_actions/docker/login-action-3.7.0
  • dependabot/github_actions/docker/login-action-4.0.0
  • dependabot/github_actions/docker/login-action-4.1.0
  • dependabot/github_actions/docker/login-action-4.2.0
  • dependabot/github_actions/docker/login-action-4.3.0
  • dependabot/github_actions/docker/login-action-4.4.0
  • dependabot/github_actions/docker/login-action-4.5.0
  • dependabot/github_actions/docker/login-action-4.5.1
  • dependabot/github_actions/docker/login-action-4.5.2
  • dependabot/github_actions/docker/login-action-4.6.0
  • dependabot/github_actions/docker/metadata-action-5
  • dependabot/github_actions/docker/metadata-action-5.10.0
  • dependabot/github_actions/docker/metadata-action-5.6.1
  • dependabot/github_actions/docker/metadata-action-5.7.0
  • dependabot/github_actions/docker/metadata-action-5.8.0
  • dependabot/github_actions/docker/metadata-action-5.9.0
  • dependabot/github_actions/docker/metadata-action-6.0.0
  • dependabot/github_actions/docker/metadata-action-6.1.0
  • dependabot/github_actions/docker/metadata-action-6.2.0
  • dependabot/github_actions/docker/setup-buildx-action-4
  • dependabot/github_actions/docker/setup-qemu-action-4
  • dependabot/github_actions/goreleaser/goreleaser-action-5
  • dependabot/github_actions/goreleaser/goreleaser-action-6
  • dependabot/github_actions/goreleaser/goreleaser-action-7
  • dependabot/go_modules/github.com/BurntSushi/toml-1.6.0
  • dependabot/go_modules/github.com/fatih/color-1.16.0
  • dependabot/go_modules/github.com/fatih/color-1.17.0
  • dependabot/go_modules/github.com/fatih/color-1.18.0
  • dependabot/go_modules/github.com/fatih/color-1.19.0
  • dependabot/go_modules/github.com/goccy/go-yaml-1.12.0
  • dependabot/go_modules/github.com/goccy/go-yaml-1.13.4
  • dependabot/go_modules/github.com/goccy/go-yaml-1.13.7
  • dependabot/go_modules/github.com/goccy/go-yaml-1.15.10
  • dependabot/go_modules/github.com/goccy/go-yaml-1.15.13
  • dependabot/go_modules/github.com/goccy/go-yaml-1.15.15
  • dependabot/go_modules/github.com/goccy/go-yaml-1.15.17
  • dependabot/go_modules/github.com/goccy/go-yaml-1.15.19
  • dependabot/go_modules/github.com/goccy/go-yaml-1.15.23
  • dependabot/go_modules/github.com/goccy/go-yaml-1.15.5
  • dependabot/go_modules/github.com/goccy/go-yaml-1.15.8
  • dependabot/go_modules/github.com/goccy/go-yaml-1.16.0
  • dependabot/go_modules/github.com/goccy/go-yaml-1.17.1
  • dependabot/go_modules/github.com/goccy/go-yaml-1.19.0
  • dependabot/go_modules/github.com/goccy/go-yaml-1.19.1
  • dependabot/go_modules/github.com/goccy/go-yaml-1.19.2
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.15.0
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.16.0
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.17.1
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.17.2
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.17.3
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.19.0
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.19.1
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.20.0
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.20.1
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.20.2
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.21.0
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.22.0
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.22.1
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.22.2
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.23.4
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.25.1
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.25.2
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.25.3
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.26.0
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.27.1
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.27.2
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.27.3
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.27.4
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.27.5
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.28.1
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.28.2
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.28.3
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.29.0
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.31.0
  • dependabot/go_modules/github.com/onsi/ginkgo/v2-2.32.0
  • dependabot/go_modules/github.com/onsi/gomega-1.31.1
  • dependabot/go_modules/github.com/onsi/gomega-1.32.0
  • dependabot/go_modules/github.com/onsi/gomega-1.33.0
  • dependabot/go_modules/github.com/onsi/gomega-1.33.1
  • dependabot/go_modules/github.com/onsi/gomega-1.34.0
  • dependabot/go_modules/github.com/onsi/gomega-1.34.2
  • dependabot/go_modules/github.com/onsi/gomega-1.35.1
  • dependabot/go_modules/github.com/onsi/gomega-1.36.0
  • dependabot/go_modules/github.com/onsi/gomega-1.36.1
  • dependabot/go_modules/github.com/onsi/gomega-1.36.2
  • dependabot/go_modules/github.com/onsi/gomega-1.37.0
  • dependabot/go_modules/github.com/onsi/gomega-1.38.0
  • dependabot/go_modules/github.com/onsi/gomega-1.38.1
  • dependabot/go_modules/github.com/onsi/gomega-1.38.2
  • dependabot/go_modules/github.com/onsi/gomega-1.39.0
  • dependabot/go_modules/github.com/onsi/gomega-1.39.1
  • dependabot/go_modules/github.com/onsi/gomega-1.40.0
  • dependabot/go_modules/github.com/onsi/gomega-1.41.0
  • dependabot/go_modules/github.com/onsi/gomega-1.42.0
  • dependabot/go_modules/github.com/onsi/gomega-1.42.1
  • dependabot/go_modules/github.com/otiai10/copy-1.14.0
  • dependabot/go_modules/github.com/otiai10/copy-1.14.1
  • dependabot/go_modules/github.com/spf13/cobra-1.10.0
  • dependabot/go_modules/github.com/spf13/cobra-1.10.2
  • dependabot/go_modules/github.com/spf13/cobra-1.8.0
  • dependabot/go_modules/github.com/spf13/cobra-1.8.1
  • dependabot/go_modules/github.com/spf13/cobra-1.9.1
  • dependabot/go_modules/github.com/spf13/pflag-1.0.10
  • dependabot/go_modules/github.com/spf13/pflag-1.0.6
  • dependabot/go_modules/github.com/spf13/pflag-1.0.7
  • dependabot/go_modules/github.com/spf13/pflag-1.0.9
  • dependabot/go_modules/github.com/stretchr/testify-1.10.0
  • dependabot/go_modules/github.com/stretchr/testify-1.11.0
  • dependabot/go_modules/golang.org/x/mod-0.18.0
  • dependabot/go_modules/golang.org/x/mod-0.19.0
  • dependabot/go_modules/golang.org/x/mod-0.20.0
  • dependabot/go_modules/golang.org/x/mod-0.21.0
  • dependabot/go_modules/golang.org/x/mod-0.22.0
  • dependabot/go_modules/golang.org/x/mod-0.23.0
  • dependabot/go_modules/golang.org/x/mod-0.25.0
  • dependabot/go_modules/golang.org/x/mod-0.26.0
  • dependabot/go_modules/golang.org/x/mod-0.27.0
  • dependabot/go_modules/golang.org/x/mod-0.28.0
  • dependabot/go_modules/golang.org/x/mod-0.29.0
  • dependabot/go_modules/golang.org/x/mod-0.30.0
  • dependabot/go_modules/golang.org/x/mod-0.31.0
  • dependabot/go_modules/golang.org/x/mod-0.32.0
  • dependabot/go_modules/golang.org/x/mod-0.33.0
  • dependabot/go_modules/golang.org/x/mod-0.34.0
  • dependabot/go_modules/golang.org/x/mod-0.35.0
  • dependabot/go_modules/golang.org/x/mod-0.36.0
  • dependabot/go_modules/golang.org/x/mod-0.37.0
  • dependabot/go_modules/golang.org/x/mod-0.38.0
  • dependabot/go_modules/gotest.tools/v3-3.5.2
  • dependabot/go_modules/kcl-lang.io/kcl-go-0.11.1
  • dependabot/go_modules/kcl-lang.io/kcl-go-0.11.2
  • dependabot/go_modules/kcl-lang.io/kcl-go-0.11.3
  • dependabot/go_modules/kcl-lang.io/kcl-go-0.8.2
  • dependabot/go_modules/kcl-lang.io/kcl-openapi-0.10.1
  • dependabot/go_modules/kcl-lang.io/kcl-openapi-0.10.2
  • dependabot/go_modules/kcl-lang.io/kcl-plugin-0.11.0
  • dependabot/go_modules/kcl-lang.io/kpm-0.11.2
  • dependabot/go_modules/kcl-lang.io/kpm-0.11.4
  • dependabot/go_modules/kcl-lang.io/kpm-0.12.4
  • dependabot/go_modules/kcl-lang.io/kpm-0.7.0
  • dependabot/go_modules/kcl-lang.io/kpm-0.9.0-rc.1
  • ench/209
  • enhance-clean-cmd
  • enhance-vet-cli-input
  • feat-add-diagnostic
  • feat-add-playgound-command
  • feat-add-queit-for-all-mod-cmd
  • feat-all-subcommands
  • feat-default-settings-file
  • feat-groupby-different-crd-version-files
  • feat-import-from-toml
  • feat-issue-296
  • feat-kcl-mod-rename-and-no-sum-check-flag
  • feat-kclx-cli-with-plugin
  • feat-plugin-framework
  • feat-run-command
  • feat-run-git-entry
  • feat-run-stdin-entry
  • feat-show-hidden-flag
  • feat-support-multiple-crd-import
  • feat-test-tool-cli
  • feat-toml-format
  • feat-xml-format
  • feat/fmt-dry-run
  • feaure/add_force
  • file-expand-for-import-tool
  • fix-cli-doc
  • fix-cli-output-trunc
  • fix-client-default-logger-to-stdout
  • fix-completion-cmd
  • fix-crd-groupby
  • fix-entry-with-pkg-deps
  • fix-example-tests
  • fix-fail-test
  • fix-git-repo-run
  • fix-homebrew-formula-directory
  • fix-image-ci
  • fix-image-lib-home-env
  • fix-json-output-sort-keys
  • fix-kcl-arm64-image-release
  • fix-kcl-lsp-install-scirpts-on-windows
  • fix-missing-print
  • fix-missing-print-09
  • fix-oci-source
  • fix-run-echo
  • fix-run-npe
  • fix-wrong-artifact-env-in-dockerfile
  • fix-wrong-crd-import-options
  • fix_image
  • fix_version
  • format-cli-documents
  • go_124
  • goreleaser-deprecation-fixes
  • init-version-option
  • issue2043-vet-cmd
  • kcl-arm64-image
  • kcl-arm64-image-test
  • kpm-related-cmd-migration
  • latest
  • login_stdin
  • main
  • mod-add-url
  • mod-graph-cmd
  • more-e2e-test
  • not_block_pr
  • patch-1
  • pull-mod-spec
  • refactor-cli-source-nil-err
  • refactor-image-release
  • refactor-mod-graph
  • refactor-vet-cli
  • refs/tags/v0.10.0-beta.1
  • refs/tags/v0.6.0
  • refs/tags/v0.6.0-alpha.4
  • refs/tags/v0.6.0-alpha.5
  • refs/tags/v0.6.0-alpha.6
  • refs/tags/v0.7.0
  • refs/tags/v0.7.0-alpha.1
  • refs/tags/v0.7.0-alpha.2
  • refs/tags/v0.7.0-beta.1
  • refs/tags/v0.7.0-beta.2
  • refs/tags/v0.7.1
  • refs/tags/v0.7.2
  • refs/tags/v0.7.3
  • refs/tags/v0.7.3-alpha.1
  • refs/tags/v0.7.4
  • refs/tags/v0.7.5
  • refs/tags/v0.8.0
  • refs/tags/v0.8.0-alpha.1
  • refs/tags/v0.8.0-beta.1
  • refs/tags/v0.8.1
  • refs/tags/v0.8.2
  • refs/tags/v0.8.3
  • refs/tags/v0.8.4
  • refs/tags/v0.8.5
  • refs/tags/v0.8.6
  • refs/tags/v0.8.7
  • refs/tags/v0.8.8
  • refs/tags/v0.8.9
  • refs/tags/v0.9.0
  • refs/tags/v0.9.0-alpha.1
  • refs/tags/v0.9.0-beta.1
  • refs/tags/v0.9.0-rc.1
  • refs/tags/v0.9.1
  • refs/tags/v0.9.2
  • refs/tags/v0.9.3
  • refs/tags/v0.9.4
  • refs/tags/v0.9.5
  • refs/tags/v0.9.6
  • refs/tags/v0.9.7
  • refs/tags/v0.9.8
  • release-0.7.1
  • release-0.9
  • release-090-tag
  • release-img
  • rename_registry
  • rm-modfile-update
  • run-mod-spec
  • server-command
  • set-log-to-stdout
  • support-add-rename
  • support-relative-path
  • supports-tls-flag
  • test-e2e-on-all-platforms
  • test-image-release
  • test-kcl-mod-pull-in-image
  • try-git-clone-in-kcl-image
  • unify-pull-cli
  • unify-run-cli
  • update_go_125
  • update_workflow
  • upgrade-goreleaser-version
  • zzz

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%)

247 of 892 relevant lines covered (27.69%)

0.3 hits per line

Relevant lines Covered
Build:
Build:
892 RELEVANT LINES 247 COVERED LINES
0.3 HITS PER LINE
Source Files on fix/version-printing-issue-363
  • Tree
  • List 11
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
31017517112 fix/version-printing-issue-363 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... Pull #364 05 Aug 2026 02:59PM UTC claude github
27.69
31015462493 fix/version-printing-issue-363 fix(cli): ensure version is correctly embedded in all release binaries (#363) Pull #364 05 Aug 2026 02:33PM UTC Claude github
27.39
See All Builds (932)

Badge your Repo: cli

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

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

Refresh
  • Settings
  • Repo on GitHub
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