Skip to content

Commit

Permalink
make: Version var not const
Browse files Browse the repository at this point in the history
  • Loading branch information
neilpa committed Mar 20, 2020
1 parent d6a7219 commit 913ec07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
ARCH := darwin/amd64 linux/386 linux/amd64 windows/386 windows/amd64
VERSION := $(shell git describe --always --dirty)
LDFLAGS := -ldflags "-X main.version=${VERSION}"

release:
gox -output 'build/{{.Dir}}.{{.OS}}.{{.Arch}}' -osarch "${ARCH}" -ldflags "-X main.version=${VERSION}"
yajsv: *.go
go build ${LDFLAGS}

release: *.go
gox -output 'build/{{.Dir}}.{{.OS}}.{{.Arch}}' -osarch "${ARCH}" ${LDFLAGS}

clean:
rm -rf build
rm -rf build yajsv
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ import (
"github.com/xeipuuv/gojsonschema"
)

const (
var (
version = "undefined"
)

var (
schemaFlag = flag.String("s", "", "primary JSON schema to validate against, required")
quietFlag = flag.Bool("q", false, "quiet, only print validation failures and errors")
versionFlag = flag.Bool("v", false, "print version and exit")
Expand Down

0 comments on commit 913ec07

Please sign in to comment.