Using ldflags to Set Version Information for Go Applications | DigitalOcean

In this tutorial, you will use the Go flag -ldflags to change the value of variables at build time and introduce your own dynamic information into a binary, …