-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.go
More file actions
32 lines (25 loc) · 664 Bytes
/
version.go
File metadata and controls
32 lines (25 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"fmt"
"runtime"
)
// These variables are initialized externally during the build. See the Makefile.
var GitCommit string
var GitLastTag string
var GitExactTag string
func printVersion() {
if GitExactTag == "undefined" {
GitExactTag = ""
}
version := GitLastTag
if GitLastTag == "" {
version = fmt.Sprintf("%s-dev-%.10s", version, GitCommit)
}
if GitCommit == "" {
fmt.Println("bleamd version: unknown (not compiled with the makefile)")
} else {
fmt.Printf("bleamd version: %s\n", version)
}
fmt.Printf("System version: %s/%s\n", runtime.GOARCH, runtime.GOOS)
fmt.Printf("Golang version: %s\n", runtime.Version())
}