diff --git a/Makefile b/Makefile index a78239a88..c4d21dc28 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ VERSION := $(shell git describe --tags) IDENTIFIER := $(VERSION)-$(GOOS)-$(GOARCH) CLONE_URL=github.com/pilosa/pilosa BUILD_TIME=`date -u +%FT%T%z` -LDFLAGS=-ldflags "-X main.Version=$(VERSION) -X main.BuildTime=$(BUILD_TIME)" +LDFLAGS=-ldflags "-X github.com/pilosa/pilosa/cmd.Version=$(VERSION) -X github.com/pilosa/pilosa/cmd.BuildTime=$(BUILD_TIME)" default: test pilosa diff --git a/cmd/server.go b/cmd/server.go index efff0ac7d..9b5821aa2 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -25,8 +25,8 @@ It will load existing data from the configured directory, and start listening client connections on the configured port.`, Run: func(cmd *cobra.Command, args []string) { - serve.Server.Handler.Version = server.Version - fmt.Fprintf(serve.Stderr, "Pilosa %s, build time %s\n", server.Version, server.BuildTime) + serve.Server.Handler.Version = Version + fmt.Fprintf(serve.Stderr, "Pilosa %s, build time %s\n", Version, BuildTime) // Parse command line arguments. if err := serve.SetupConfig(args); err != nil { diff --git a/server/server.go b/server/server.go index 845340485..85b3dbb77 100644 --- a/server/server.go +++ b/server/server.go @@ -14,20 +14,7 @@ import ( "github.com/pilosa/pilosa" ) -// Version and BuildTime hold the version/build time information passed in at compile time. -var ( - Version string - BuildTime string -) - func init() { - if Version == "" { - Version = "v0.0.0" - } - if BuildTime == "" { - BuildTime = "not recorded" - } - rand.Seed(time.Now().UTC().UnixNano()) }