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:
go test ./...
build:
go build ${LDFLAGS}
go build

View File

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