refactor(Magefile): add build info in backend:build through ldflags
This commit is contained in:
21
internal/utils/version.go
Normal file
21
internal/utils/version.go
Normal file
@ -0,0 +1,21 @@
|
||||
package utils
|
||||
|
||||
var (
|
||||
version = "dev"
|
||||
commitHash = "none"
|
||||
buildDate = "unknown"
|
||||
)
|
||||
|
||||
type Info struct {
|
||||
Version string
|
||||
CommitHash string
|
||||
BuildDate string
|
||||
}
|
||||
|
||||
func Version() Info {
|
||||
return Info{
|
||||
Version: version,
|
||||
CommitHash: commitHash,
|
||||
BuildDate: buildDate,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user