diff --git a/main.go b/main.go index f9827e2..c96147c 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,7 @@ import ( "net/http" "os" "path" + "runtime/debug" "strconv" "strings" "sync" @@ -51,7 +52,17 @@ func main() { glist.DataPath = dataPath - log.Printf("Grocery List bot starting with datapath:%s, port:%d\n", dataPath, port) + commit := "unknown" + + if bi, ok := debug.ReadBuildInfo(); ok { + for _, s := range bi.Settings { + if s.Key == "vcs.revision" { + commit = s.Value[:8] + } + } + } + + log.Printf("Grocery List bot (%s) starting with datapath:%s, port:%d\n", commit, dataPath, port) var chats sync.Map if err := loadData(dataPath, &chats); err != nil {