Currently, the 'goVersion' function is run without any directory set. This is problematic when a build uses the 'dir' config in combination with the 'gobinary' config. When 'gobinary' is a relative path (like a script in the current repository), goVersion silently fails, returning an empty string. This commit refactors 'goVersion' to execute the command with '.Dir' set to the 'build.Dir', in addition to now returning an error, so that issues may be bubbled up in the build log, rather than silently failing. It also adds a new helper function to facilitate running 'goVersion' by creating a temporary executable that outputs a given 'version' string. This function is only currently used by 'TestWithDefaults'. Co-authored-by: Rob Prentiss <prentiss@apple.com>
GoReleaser
Deliver Go binaries as fast and easily as possible.
GoReleaser builds Go binaries for several platforms, creates a GitHub release and then pushes a Homebrew formula to a tap repository. All that wrapped in your favorite CI.
This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. We appreciate your contribution. Please refer to our contributing guidelines for further information.
For questions, support and general discussion, please use GitHub Discussions;
Get GoReleaser
Documentation
Documentation is hosted live at https://goreleaser.com
Badges
Sponsors
Does your company use goreleaser? Help keep the project bug-free and feature rich by sponsoring the project.
Backers
Love our work and community? Become a backer.
Contributors
This project exists thanks to all the people who contribute. [Contribute].