Skip to content

Commit

Permalink
refactor: version print change
Browse files Browse the repository at this point in the history
  • Loading branch information
anilmisirlioglu committed Apr 9, 2022
1 parent fc8082b commit f3b3426
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ import (
)

var (
GitCommitSHA = "unknown"
BuildDate = "unknown"
commit = "unknown"
date = "unknown"
)

type CLIVersionInfo struct {
Version string
GitCommitSHA string
BuildDate string
GoVersion string
Compiler string
Platform string
Version string `json:"version"`
Commit string `json:"commit"`
Date string `json:"date"`
GoVersion string `json:"go"`
Compiler string `json:"compiler"`
Platform string `json:"platform"`
}

func VersionInfo() *CLIVersionInfo {
return &CLIVersionInfo{
Version: internal.Version,
GitCommitSHA: GitCommitSHA,
BuildDate: BuildDate,
GoVersion: runtime.Version(),
Compiler: runtime.Compiler,
Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
Version: internal.Version,
Commit: commit,
Date: date,
GoVersion: runtime.Version(),
Compiler: runtime.Compiler,
Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package internal

const Version = "0.0.1"
var Version = "dev"

0 comments on commit f3b3426

Please sign in to comment.