diff --git a/Makefile b/Makefile index 527cea1b..a6b47ced 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,11 @@ GOFMT=gofmt GC=go build +VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) +Minversion := $(shell date) +BUILD_PAR = -ldflags "-X main.Version=$(VERSION)" all: - $(GC) main.go + $(GC) $(BUILD_PAR) main.go format: $(GOFMT) -w main.go diff --git a/main.go b/main.go index d9c8602c..07aff864 100644 --- a/main.go +++ b/main.go @@ -19,6 +19,8 @@ const ( NCPU = 4 ) +var Version string + func init() { runtime.GOMAXPROCS(NCPU) var path string = "./Log/" @@ -26,6 +28,7 @@ func init() { } func main() { + fmt.Printf("Node version: %s\n", Version) fmt.Println("//**************************************************************************") fmt.Println("//*** 0. Client Set ***") fmt.Println("//**************************************************************************")