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:
parent
53bc1cfbd8
commit
b67b5d6b7e
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue