Enhances version info retrieval
Improves the `version` command to automatically extract build details (version, commit, date) from Go's `debug.ReadBuildInfo` when `ldflags` are not provided. This allows users installing via `go install` to receive accurate version information without requiring a Makefile or explicit build flags. Updates the README to reflect this new capability.
This commit is contained in:
@@ -152,6 +152,8 @@ The Makefile automatically injects version information from git tags:
|
||||
- `Commit`: Short commit hash
|
||||
- `Date`: Build timestamp
|
||||
|
||||
**Note:** Version information is automatically included when installing via `go install` (no Makefile needed). The tool reads version info from Go's build metadata.
|
||||
|
||||
Check the version after installing:
|
||||
```bash
|
||||
gitlocal version
|
||||
|
||||
Reference in New Issue
Block a user