File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 55
66builds :
77 - main : .
8- ldflags :
9- - -s -w
108 flags :
119 - -trimpath
1210 - -v
Original file line number Diff line number Diff line change @@ -15,11 +15,13 @@ import (
1515 kingpin "gopkg.in/alecthomas/kingpin.v2"
1616)
1717
18- const (
19- versionStr = "0.11.0"
20- )
21-
2218var (
19+ // these values are provided automatically by Goreleaser
20+ // ref: https://goreleaser.com/customization/builds/
21+ version = "dev"
22+ commit = "none"
23+ date = "unknown"
24+
2325 // Flags
2426 baseFormatterCmd = kingpin .Flag (
2527 "base-formatter" ,
6466 tabLen = kingpin .Flag (
6567 "tab-len" ,
6668 "Length of a tab" ).Short ('t' ).Default ("4" ).Int ()
67- version = kingpin .Flag (
69+ versionFlag = kingpin .Flag (
6870 "version" ,
6971 "Print out version and exit" ).Default ("false" ).Bool ()
7072 writeOutput = kingpin .Flag (
@@ -86,8 +88,9 @@ func main() {
8688 log .SetLevel (log .InfoLevel )
8789 }
8890
89- if * version {
90- fmt .Printf ("golines v%s\n " , versionStr )
91+ if * versionFlag {
92+ fmt .Printf ("golines v%s\n \n build information:\n \t build date: %s\n \t git commit ref: %s\n " ,
93+ version , date , commit )
9194 return
9295 }
9396
You can’t perform that action at this time.
0 commit comments