Skip to content

Commit

Permalink
manual versioning for binary app
Browse files Browse the repository at this point in the history
  • Loading branch information
magodo committed Aug 29, 2021
1 parent 8cbbbdc commit b555edf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
2 changes: 0 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ builds:
- linux
- windows
- darwin
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
archives:
- replacements:
darwin: Darwin
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func main() {
flag.Parse()

if *flagVersion {
fmt.Println(getVersion())
fmt.Println(version)
os.Exit(0)
}

Expand Down
12 changes: 1 addition & 11 deletions version.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
package main

import "fmt"

var (
// Followings are filled by compiler during goreleaser
version string = "dev"
commit string = "unknown"
)

func getVersion() string {
return fmt.Sprintf("%s (%s)", version, commit)
}
var version string = "v0.0.2"

0 comments on commit b555edf

Please sign in to comment.