This guide provides a straightforward method for embedding the current Git hash into a Go binary at compile time. Following these steps ensures that application versions can be easily and accurately identified.
https://blog.carlana.net/post/2023/golang-git-hash-how-to/
Post #150
155