How to include Git version information in Go



TL;DR: Just import github.com/carlmjohnson/versioninfo and use versioninfo.Revision to automatically include a Git hash in your Go application.



Curious how it works? Want to make your own version info package? Read on.



https://blog.carlmjohnson.net/post/2023/golang-git-hash-how-to