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:
2026-04-11 15:00:06 +01:00
parent d00ffdb37c
commit 6e21a0798a
2 changed files with 33 additions and 4 deletions

View File

@@ -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