Show git commit version on startup
This commit is contained in:
parent
0354436ab6
commit
ab75014a19
13
main.go
13
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user