Merge pull request #286 from travisturner/use-build-version

use the Version parameter (as opposed to Build) as the version in handler
This commit is contained in:
Travis Turner 2017-02-07 16:49:08 -06:00 committed by GitHub
commit bd9e3760e3
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 = "v0.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 {