Is a repository that contains differents ways to build your Go app and set the version on it.
Splitted in different files in which you will define the variable values.
Non prod build:
// +build !prod
// Package name -> P.E
package main
// const which you will set with that value -> P.E
const version = "development"// +build prod
// Package name -> P.E
package main
// const which you will set with that value -> P.E
const version = "production"Build go with tags for NON pro
go buildBuild go with tags for pro
go build -tags prodBuild go with git commit id:
go build -ldflags "-X main.version=$(git rev-parse HEAD)"