Skip to content

Commit

Permalink
Merge pull request #55 from kyoshidajp/change_version_format
Browse files Browse the repository at this point in the history
Change version format
  • Loading branch information
kyoshidajp authored Nov 30, 2023
2 parents ded49da + b28ea61 commit 40ec136
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ builds:
ldflags:
- -s -w
- -X github.com/kyoshidajp/dep-doctor/cmd.Version={{.Version}}
- -X github.com/kyoshidajp/dep-doctor/cmd.Revision={{.ShortCommit}}
goos:
- linux
- windows
Expand Down
6 changes: 2 additions & 4 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ import (
)

var (
Revision = "0"
Version = "1"
Version = "1.1.0"
)

func getVersion() string {
return fmt.Sprintf(`Version: %s
Revision: %s
OS: %s
Arch: %s`, Version, Revision, runtime.GOOS, runtime.GOARCH)
Arch: %s`, Version, runtime.GOOS, runtime.GOARCH)
}

func newVersionCmd() *cobra.Command {
Expand Down
3 changes: 1 addition & 2 deletions cmd/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (
func TestGetVersion(t *testing.T) {
got := getVersion()
want := fmt.Sprintf(`Version: %s
Revision: %s
OS: %s
Arch: %s`, Version, Revision, runtime.GOOS, runtime.GOARCH)
Arch: %s`, Version, runtime.GOOS, runtime.GOARCH)

if want != got {
t.Fatalf("unexpected version info. want: %s, got: %s", want, got)
Expand Down

0 comments on commit 40ec136

Please sign in to comment.