use the Build parameter as the Version in handler

Standardize on `Version` for the build version
This commit is contained in:
Travis 2017-02-02 10:31:06 -06:00
parent c2253a36ea
commit d0bdea11c5
3 changed files with 6 additions and 9 deletions

View file

@ -17,12 +17,12 @@ import (
"github.com/pilosa/pilosa"
)
// Build holds the build information passed in at compile time.
var Build string
// Version holds the version information passed in at compile time.
var Version string
func init() {
if Build == "" {
Build = "v0.0.0"
if Version == "" {
Version = "0.0.0"
}
rand.Seed(time.Now().UTC().UnixNano())
@ -35,7 +35,8 @@ const (
func main() {
m := NewMain()
fmt.Fprintf(m.Stderr, "Pilosa %s\n", Build)
m.Server.Handler.Version = Version
fmt.Fprintf(m.Stderr, "Pilosa %s\n", Version)
// Parse command line arguments.
if err := m.ParseFlags(os.Args[1:]); err != nil {

View file

@ -45,7 +45,6 @@ type Handler struct {
// NewHandler returns a new instance of Handler with a default logger.
func NewHandler() *Handler {
return &Handler{
Version: Version,
LogOutput: os.Stderr,
}
}

View file

@ -23,9 +23,6 @@ var (
ErrQueryRequired = errors.New("query required")
)
// Version represents the current running version of Pilosa.
var Version string
// Profile represents vertical column in a database.
// A profile can have a set of attributes attached to it.
type Profile struct {