Skip to content

Commit bc9f97c

Browse files
committed
fix(version): fix version desc and output
1 parent 462254b commit bc9f97c

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

cmd/version.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,38 @@ package cmd
33
import (
44
"fmt"
55

6-
"github.com/zackijack/go-project/internal/version"
76
"github.com/spf13/cobra"
7+
"github.com/zackijack/go-project/internal/version"
88
)
99

1010
const versionDesc = `
11-
Showing who exactly go-project is.
12-
This will print a representation profile of go-project.
11+
Show the version for go-project.
12+
This will print a representation the version of go-project.
1313
The output will look something like this:
1414
15-
Version: v1.0.0
16-
Git Commit: ff52399e51bb880526e9cd0ed8386f6433b74da1
17-
Build Date: 2020-07-27-17:07:02
18-
Go Version: go1.14.6
19-
OS Arch: darwin amd64
15+
Version : v1.0.0
16+
Git Commit : ff52399e51bb880526e9cd0ed8386f6433b74da1
17+
Build Date : 2020-07-27-17:07:02
18+
Go Version : go1.16.5
19+
OS / Arch : darwin / amd64
2020
2121
- Version is the semantic version of the release.
2222
- Git Commit is the SHA for the commit that this version was built from.
2323
- Build Date is the date when the application was built.
2424
- Go Version is the version of the Go compiler used.
25-
- OS Arch is the version of the operating system and architecture was built for.
25+
- OS / Arch is the version of the operating system and architecture was built for.
2626
`
2727

2828
var versionCmd = &cobra.Command{
2929
Use: "version",
3030
Short: "Reveal go-project personal information",
3131
Long: versionDesc,
3232
Run: func(cmd *cobra.Command, args []string) {
33-
fmt.Println("Version:", version.Version)
34-
fmt.Println("Git Commit:", version.GitCommit)
35-
fmt.Println("Build Date:", version.BuildDate)
36-
fmt.Println("Go Version:", version.GoVersion)
37-
fmt.Println("OS Arch:", version.OsArch)
33+
fmt.Println("Version :", version.Version)
34+
fmt.Println("Git Commit :", version.GitCommit)
35+
fmt.Println("Build Date :", version.BuildDate)
36+
fmt.Println("Go Version :", version.GoVersion)
37+
fmt.Println("OS / Arch :", version.OsArch)
3838
},
3939
}
4040

internal/version/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ var BuildDate string
1818
var GoVersion = runtime.Version()
1919

2020
// OsArch is the version of operating system and architecture.
21-
var OsArch = fmt.Sprintf("%s %s", runtime.GOOS, runtime.GOARCH)
21+
var OsArch = fmt.Sprintf("%s / %s", runtime.GOOS, runtime.GOARCH)

0 commit comments

Comments
 (0)