internal/app/version.go   A
last analyzed

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 18
dl 0
loc 25
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A app.PrintVersion 0 11 2
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
	}
27
}
28