-
Notifications
You must be signed in to change notification settings - Fork 4
/
version.go
42 lines (36 loc) · 817 Bytes
/
version.go
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
33
34
35
36
37
38
39
40
41
42
/*
Copyright (c) 2019 Kazuki Suda <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
*/
package ksort
import (
"fmt"
"runtime"
)
var (
GitVersion = "v0.0.0"
GitCommit = "$Format:%H$"
GitTreeState = "dirty"
BuildDate = "1970-01-01T00:00:00Z"
)
type info struct {
GitVersion string
GitCommit string
GitTreeState string
BuildDate string
GoVersion string
Compiler string
Platform string
}
func newInfo() *info {
return &info{
GitVersion: GitVersion,
GitCommit: GitCommit,
GitTreeState: GitTreeState,
BuildDate: BuildDate,
GoVersion: runtime.Version(),
Compiler: runtime.Compiler,
Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
}
}