fix embedded build information

This commit is contained in:
Henry 2021-05-20 08:49:29 +02:00
parent 1f680c5cf6
commit a537596a5a
1 changed files with 10 additions and 11 deletions

View File

@ -41,8 +41,16 @@ import (
"github.com/ssb-ngi-pointer/go-ssb-room/web/handlers"
)
// Version and Build are set by ldflags
var (
version = "v1.0.0-snapshot"
commit = "unset"
)
var (
// flags
flagPrintVersion bool
flagDisableUNIXSock bool
listenAddrShsMux string
@ -65,14 +73,6 @@ var (
appKey string
)
// Version and Build are set by ldflags
var (
Version = "snapshot"
Build = ""
flagPrintVersion bool
)
func checkFatal(err error) {
checkAndLog(err)
if err != nil {
@ -140,7 +140,7 @@ func runroomsrv() error {
initFlags()
if flagPrintVersion {
log.Log("version", Version, "build", Build)
level.Info(log).Log("version", version, "commit", commit)
return nil
}
@ -376,8 +376,7 @@ func runroomsrv() error {
"ID", roomsrv.Whoami().Ref(),
"shsmuxaddr", listenAddrShsMux,
"httpaddr", listenAddrHTTP,
"version", Version,
"build", Build,
"version", version, "commit", commit,
)
// start serving http connections