Dear all
I'm a 3rd cli tool developer, and most of my users install the cli tool via
go install github.com/example/mycli. I got trouble for attaching the revision by default so users could run
mycli version to get a revision(tag or git commit).
The known workarounds cannot solve my problem:
1. put the tag inside the codebase: doesn't work for commit because i cannot know the concrete commit before committing
2. pass it by ldflag: doesn't work because i cannot ask users to attach the version, that's quite dummy
The ideal way is that during go install the go compiler could help attach this information, but i haven't found this related docs. Could anyone provide some ideas about it?
If the ideal way is not possible, is it possible to get the revision after users install my cli tool via go install?
xieyuschen
Regards