go-junit-report icon indicating copy to clipboard operation
go-junit-report copied to clipboard

`-version` info is "not as useful" as it may should've been

Open stdedos opened this issue 3 years ago • 1 comments

Version in the tagged version: https://github.com/jstemmer/go-junit-report/blob/7fde4641acef5b92f397a8baf8309d1a45d608cc/main.go#L14-L18

Version @https://github.com/jstemmer/go-junit-report/blob/master as of now: https://github.com/jstemmer/go-junit-report/blob/e939e4f1208c5433ce0aed4cec28d84bbdbcda8d/main.go#L18-L22

May I suggest something along the lines of:

//go:generate sh -c "git describe --tags --first-parent --abbrev=0 > commit.txt"
//go:embed commit.txt

for "rolling" builds, and "hardcoded" changes on tagged commits

stdedos avatar Dec 05 '22 13:12 stdedos

This is not an issue in the compiled binary.

# https://github.com/jstemmer/go-junit-report/releases/tag/v2.0.0
❯ tar xfzv go-junit-report-v2.0.0-darwin-amd64.tar.gz 
x go-junit-report
❯ ./go-junit-report -version
go-junit-report v2.0.0 2022-07-01T22:11:51 (7fde4641acef5b92f397a8baf8309d1a45d608cc)

# https://github.com/jstemmer/go-junit-report/releases/tag/v2.1.0
❯ tar xfzv go-junit-report-v2.1.0-darwin-arm64.tar.gz
x go-junit-report
❯ ./go-junit-report -version
go-junit-report v2.1.0 2023-10-18T23:51:04 (14d61e6e75e3f3c74551d757ad936e8e88014464)

See also: https://github.com/jstemmer/go-junit-report/blob/85bf4716ac1f025f2925510a9f5e9f5bb347c009/Makefile#L1-L3

joschi avatar Jun 28 '24 12:06 joschi