Skip to content

Commit 027e12b

Browse files
committed
let golereleaser to set version
1 parent fccd769 commit 027e12b

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

main.go

+8-9
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,23 @@ import (
2020
"golang.org/x/sync/errgroup"
2121
)
2222

23-
// Version of application
24-
var Version string
25-
26-
func init() {
27-
if Version == "" {
28-
Version = "v0.0.0"
29-
}
30-
}
23+
var (
24+
version = "v0.0.0"
25+
commit = "none"
26+
date = "unknown"
27+
)
3128

3229
var (
3330
versionFlag = flag.Bool("version", false, "version")
3431
configPath = flag.String("config", "config.toml", "config file path")
3532
)
3633

3734
func main() {
35+
fmt.Printf("Starting PAS version: %s, commit: %s, built: %s", version, commit, date)
36+
3837
flag.Parse()
3938
if *versionFlag {
40-
fmt.Println(Version)
39+
fmt.Println(version)
4140
return
4241
}
4342

0 commit comments

Comments
 (0)