diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..87b4f05 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,8 @@ +run: + allow-parallel-runners: true +linters: + enable: + - golint + disable: + - errcheck + - typecheck diff --git a/Makefile b/Makefile index 090cd2f..22989fa 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ # Makefile VERSION := 2.5.5 -LDFLAGS ?= "-s -w -X main.GitCommit=$(shell git rev-parse --short HEAD) -X 'main.BuildTime=$(shell date '+%Y-%m-%d %H:%M:%S')'" +LDFLAGS ?= "-s -w -X github.com/chengshiwen/influx-proxy/backend.Version=$(VERSION) -X main.GitCommit=$(shell git rev-parse --short HEAD) -X 'main.BuildTime=$(shell date '+%Y-%m-%d %H:%M:%S')'" GOBUILD_ENV = GO111MODULE=on CGO_ENABLED=0 -GOBUILD = $(GOBUILD_ENV) go build -o bin/influx-proxy -a -ldflags $(LDFLAGS) +GOBUILD = go build -o bin/influx-proxy -a -ldflags $(LDFLAGS) GOX = go run github.com/mitchellh/gox TARGETS := darwin/amd64 linux/amd64 windows/amd64 -DIST_DIRS := find * -type d -maxdepth 0 -exec +DIST_DIRS := find * -maxdepth 0 -type d -exec .PHONY: build linux cross-build release test bench run lint down tidy clean diff --git a/backend/config.go b/backend/config.go index 8c6085b..881e6cd 100644 --- a/backend/config.go +++ b/backend/config.go @@ -12,9 +12,7 @@ import ( "github.com/spf13/viper" ) -const ( - Version = "2.5.5" -) +var Version = "not build" var ( ErrEmptyCircles = errors.New("circles cannot be empty")