mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-07-02 11:43:42 +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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
@ -18,6 +19,10 @@ var pidFile string
|
||||||
// Global variables
|
// 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.
|
// File descriptor to the current log file.
|
||||||
var logfd *os.File
|
var logfd *os.File
|
||||||
|
|
||||||
|
|
@ -135,7 +140,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if version {
|
if version {
|
||||||
print("Version: v1.2.2\n")
|
fmt.Printf("Version: %s\n", VersionString)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue