Skip to content

Commit

Permalink
Add version information
Browse files Browse the repository at this point in the history
  • Loading branch information
andylibrian committed Mar 13, 2021
1 parent 4324d97 commit 80be4af
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ builds:
- windows
- darwin
main: ./cmd/terjang/main.go
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
- -X main.version={{.Version}} -X main.commit={{.Commit}}
checksum:
name_template: 'checksums.txt'
snapshot:
Expand All @@ -20,3 +23,9 @@ changelog:
exclude:
- '^docs:'
- '^test:'
- Merge pull request
- Merge branch
archives:
- format_overrides:
- goos: windows
format: zip
11 changes: 9 additions & 2 deletions cmd/terjang/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import (
"go.uber.org/zap"
)

// nolint: gochecknoglobals
var (
version = "dev"
commit = "main"
)

func main() {
app := getCliApp()

Expand All @@ -21,8 +27,9 @@ func main() {

func getCliApp() *cli.App {
return &cli.App{
Name: "Terjang",
Usage: "A scalable HTTP load testing tool built on Vegeta.",
Name: "Terjang",
Usage: "A scalable HTTP load testing tool built on Vegeta.",
Version: version + " (" + commit + ")",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "log-level",
Expand Down

0 comments on commit 80be4af

Please sign in to comment.