embedded version

This commit is contained in:
Thomas Rudin 2019-01-08 08:47:28 +01:00
parent 5f9180efaf
commit 8740ad76f4
2 changed files with 3 additions and 9 deletions

View File

@ -1,9 +1,6 @@
VERSION=2.0
LDFLAGS=-ldflags "-w -s -X main.Version=${VERSION}"
test: test:
go test ./... go test ./...
build: build:
go build ${LDFLAGS} go build

View File

@ -7,8 +7,8 @@ import (
"fmt" "fmt"
) )
var ( const (
Version string Version = "2.0-DEV"
) )
func main() { func main() {
@ -21,9 +21,6 @@ func main() {
if p.Version { if p.Version {
fmt.Print("Mapserver version: ") fmt.Print("Mapserver version: ")
if Version == "" {
Version = "SNAPSHOT"
}
fmt.Println(Version) fmt.Println(Version)
return return
} }