feat(cli): enhance CLI version information#52
Open
Saisathvik94 wants to merge 3 commits into
Open
Conversation
* Embed commit hash, build date, Go version, and OS/architecture into binaries. * Update `Makefile` and `.goreleaser.yaml` to inject build metadata via `ldflags`. * Implement custom `--version` flag handling with a verbose option for detailed output. * Improve debuggability and traceability of deployed binaries.
|
First PR — welcome aboard! A few things to expect:
If you get stuck, reply here or jump to Discussions. We want this PR to land. |
…ion` entry * Add `--version --verbose` to the list of available commands. * Include `--version --verbose` in the table of general flags. * Explicitly list `--version` in the general flags table. * Enhance clarity regarding CLI options in the README.
* Replaced tab characters with spaces for variable declarations. * Corrected indentation within the `main` function. * Adjusted indentation for flags in the `newRootCmd` function. * Ensured consistent code formatting throughout the file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makefileand.goreleaser.yamlto inject build metadata vialdflags.--versionflag handling with a verbose option for detailed output.What
Why
Providing build metadata in binaries improves traceability, debugging, and release verification. Users and maintainers can quickly determine exactly which source revision produced a binary, when it was built, and the runtime/platform it targets. This is especially useful when troubleshooting issues reported against released artifacts.
Fixes #10
How
Testing
make lint testpasses locallygo test -race ./...passestestdata/and a golden outputChecklist
feat(scope): subject)git commit -s)