| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package app |
||
| 2 | |||
| 3 | import ( |
||
| 4 | "encoding/json" |
||
| 5 | "fmt" |
||
| 6 | "os" |
||
| 7 | ) |
||
| 8 | |||
| 9 | var ( |
||
| 10 | release = "UNKNOWN" |
||
| 11 | buildDate = "UNKNOWN" |
||
| 12 | gitHash = "UNKNOWN" |
||
| 13 | ) |
||
| 14 | |||
| 15 | func PrintVersion() { |
||
| 16 | if err := json.NewEncoder(os.Stdout).Encode(struct { |
||
| 17 | Release string |
||
| 18 | BuildDate string |
||
| 19 | GitHash string |
||
| 20 | }{ |
||
| 21 | Release: release, |
||
| 22 | BuildDate: buildDate, |
||
| 23 | GitHash: gitHash, |
||
| 24 | }); err != nil { |
||
| 25 | fmt.Printf("error while decode version info: %v\n", err) |
||
| 26 | } |
||
| 28 |