-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.go
58 lines (54 loc) · 2 KB
/
info.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package build
import (
"os"
"path"
)
// NOTE: these variables are populated at compile time by using the -ldflags
// linker flag:
// $> go build -ldflags "-X github.com/dihedron/graphstack/build.GitHash=$(hash)"
// in order to get the package path to the GitHash variable to use in the
// linker flag, use the nm utility and look for the variable in the built
// application symbols, then use its path in the linker flag:
// $> nm ./graphstack | grep GitHash
// 00000000015db9c0 b github.com/dihedron/graphstack/build.GitHash
var (
// Name is the name of the application or plugin.
Name string
// Description is a one-liner description of the application or plugin.
Description string
// Copyright is the copyright clause of the application or plugin.
Copyright string
// License is the license under which the code is released.
License string
// LicenseURL is the URL at which the license is available.
LicenseURL string
// BuildTime is the time at which the application was built.
BuildTime string
// BuildDate is the date on which the application was built.
BuildDate string
// GitTag is the current Git tag (e.g. "1.0.3").
GitTag string
// GitCommit is the commit of this version of the application.
GitCommit string
// GitHash is the long hash of the Git commit.
GitHash string
// GoVersion is the version of the Go compiler used in the build process.
GoVersion string
// GoOS is the operating system used to build this application; it may differ
// from that of the compiler in case of cross-compilation (GOOS).
GoOS string
// GoOS is the architecture used during the build of this application; it
// may differ from that of the compiler in case of cross-compilation (GOARCH).
GoArch string
// VersionMajor is the major version of the application.
VersionMajor = "0"
// VersionMinor is the minor version of the application.
VersionMinor = "0"
// VersionPatch is the patch or revision level of the application.
VersionPatch = "0"
)
func init() {
if Name == "" {
Name = path.Base(os.Args[0])
}
}