1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-18 05:00:03 +02:00

src/main.go: use a global variable to display version number, this should be set by the linker during build.

This commit is contained in:
Henrik Hautakoski 2022-08-21 20:46:40 +02:00
parent 53bc1cfbd8
commit b67b5d6b7e
No known key found for this signature in database
GPG key ID: 608414D93E862CCD

View file

@ -1,6 +1,7 @@
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
@ -18,6 +19,10 @@ var pidFile string
// Global variables
// ---------------------------------------------------------
// Version string, should be updated by the go linker (by passing "-X main.VersionString=value" to the linker)
// see: https://pkg.go.dev/cmd/link and
var VersionString string = "-"
// File descriptor to the current log file.
var logfd *os.File
@ -135,7 +140,7 @@ func main() {
}
if version {
print("Version: v1.2.2\n")
fmt.Printf("Version: %s\n", VersionString)
return;
}