Hi
I still got version “(devel)”
package main
import (
"fmt"
"runtime/debug"
)
func main() {
bi, ok := debug.ReadBuildInfo()
if !ok {
panic("not ok")
}
fmt.Printf("%+v", bi)
}
Output:
&{GoVersion:go1.18beta1 Path:play.com/buildinfo Main:{Path:play.com/buildinfo Version:(devel) Sum: Replace:<nil>} Deps:[] Settings:[{Key:-compiler Value:gc} {Key:CGO_ENABLED Value:0} {Key:GOARCH Value:amd64} {Key:GOOS Value:darwin} {Key:GOAMD64 Value:v1} {Key:vcs Value:git} {Key:vcs.revision Value:bd21e4e6b920b1277fc1cbb3e02612220b0d4989} {Key:vcs.time Value:2022-01-11T14:46:27Z} {Key:vcs.modified Value:false}]}
Running:
git log
commit bd21e4e6b920b1277fc1cbb3e02612220b0d4989 (HEAD -> main, tag: v1.0.0)
Author: Micke
Date: Tue Jan 11 15:46:27 2022 +0100
intial