diff --git a/client.go b/client.go index 4517709..1387f79 100644 --- a/client.go +++ b/client.go @@ -11,8 +11,12 @@ import ( "time" ) -// GitHash is the sha hash of the current commit used to build this code. -var GitHash string +var ( + // GitHash is the sha hash of the current commit used to build this code. + GitHash string + // Version is the semantic version according to the release. + Version string +) // Client is used to make calls to the septa website. type Client struct { diff --git a/cmd/septa/septa.go b/cmd/septa/septa.go index e776f39..60738d3 100644 --- a/cmd/septa/septa.go +++ b/cmd/septa/septa.go @@ -22,7 +22,7 @@ func init() { // Version prints the version from the septa.GitHash out and exits. func Version(ctx context.Context) { - fmt.Printf("Version: %v\n", septa.GitHash) + fmt.Printf("Version: %v %v\n", septa.Version, septa.GitHash) } // Usage prints how to invoke `septa` from the command line. diff --git a/go.mod b/go.mod index a0148aa..aecb550 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,6 @@ require ( github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989 // indirect golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect golang.org/x/mod v0.4.0 // indirect - golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e // indirect + golang.org/x/tools v0.0.0-20210102185154-773b96fafca2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 33e023e..907667b 100644 --- a/go.sum +++ b/go.sum @@ -79,6 +79,8 @@ golang.org/x/tools v0.0.0-20201223200349-f6952e403d3f h1:bQhvijM1G4xRg8EoTAIvy+e golang.org/x/tools v0.0.0-20201223200349-f6952e403d3f/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210102185154-773b96fafca2 h1:crjwvdT+rSAILpNOKhk/BNmefsucqGTeeRX2YBK/6Jg= +golang.org/x/tools v0.0.0-20210102185154-773b96fafca2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/makefile b/makefile index 001e3b6..066e09b 100644 --- a/makefile +++ b/makefile @@ -3,8 +3,9 @@ GOLANG := golang:1.15 GOOS := darwin +VERSION := 1.1.1 GIT_HASH = $(shell git rev-parse --short HEAD) -LDFLAGS := "-X github.com/dherbst/septa.GitHash=${GIT_HASH}" +LDFLAGS := "-X github.com/dherbst/septa.GitHash=${GIT_HASH} -X github.com/dherbst/septa.Version=${VERSION}" all: clean pull lint sec test build install