File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ var (
4
+ semVer string
5
+ commitHash string
6
+ isGitDirty string
7
+ isSnapshot string
8
+ goOs string
9
+ goArch string
10
+ gitUrl string
11
+ builtBranch string
12
+ builtDate string
13
+ )
14
+
15
+ var semReleaseVersion string = semVer +
16
+ func(pre string, txt string) string {
17
+ if len(txt) > 0 {
18
+ return pre + txt
19
+ } else {
20
+ return ""
21
+ }
22
+ }("+", goArch) +
23
+ func(pre string, txt string) string {
24
+ if len(txt) > 0 {
25
+ return pre + txt
26
+ } else {
27
+ return ""
28
+ }
29
+ }(".", builtBranch) +
30
+ func(pre string, txt string) string {
31
+ if len(txt) > 0 {
32
+ return pre + txt
33
+ } else {
34
+ return ""
35
+ }
36
+ }(".", commitHash)
37
+
38
+ func main() {
39
+ println("release version:", semReleaseVersion)
40
+ println()
41
+ println("semVer:", semVer)
42
+ println("commitHash:", commitHash)
43
+ println("isGitDirty:", isGitDirty)
44
+ println("isSnapshot:", isSnapshot)
45
+ println("goOs:", goOs)
46
+ println("goArch:", goArch)
47
+ println("gitUrl:", gitUrl)
48
+ println("builtBranch:", builtBranch)
49
+ println("builtDate:", builtDate)
50
+ }
You can’t perform that action at this time.
0 commit comments