Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds version information support to the application by integrating the github.com/veerendra2/gopackages/version package. The changes enable version tracking during builds and provide runtime version information display.
- Added version flag to CLI that prints version and exits
- Integrated version package with build-time ldflags injection for Taskfile and GoReleaser configurations
- Extended build system to support multiple platforms (linux/darwin) and architectures (amd64/arm64)
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| main.go | Added version flag, import statements, and logging of version/build context information |
| Taskfile.yml | Added version-related variables and updated build tasks with ldflags for version injection; added multi-platform build task |
| .goreleaser.yml | Added darwin OS, arm64 architecture support, and ldflags for version injection |
| README.md | Added build and test instructions using Taskfile and goreleaser |
| .gitignore | Added dist directory to ignore build artifacts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
main.go
Outdated
| ) | ||
|
|
||
| if cli.Version { | ||
| println(version.Version) |
There was a problem hiding this comment.
Using println is not recommended for production code as it writes to stderr and is primarily for debugging. Consider using fmt.Println instead, which writes to stdout and is the standard way to output information to users.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| go build -ldflags "\ | ||
| -X github.com/veerendra2/gopackages/version.Version={{.VERSION}} \ | ||
| -X github.com/veerendra2/gopackages/version.Revision={{.REVISION}} \ | ||
| -X github.com/veerendra2/gopackages/version.Branch={{.BRANCH}} \ | ||
| -X github.com/veerendra2/gopackages/version.BuildUser={{.BUILD_USER}} \ | ||
| -X github.com/veerendra2/gopackages/version.BuildDate={{.BUILD_TIME}}" \ | ||
| -o dist/{{.APP_NAME}} {{.MAIN_FILE}} |
There was a problem hiding this comment.
The ldflags configuration is duplicated between the build and build-platforms tasks. Consider extracting this into a shared variable or template to reduce duplication and ensure consistency.
No description provided.