Skip to content

Commit 7a6729d

Browse files
authored
read go version from runtime (#43)
1 parent 14c4765 commit 7a6729d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Makefile

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ BINARY_NAME=crowdsec-custom-bouncer
1212

1313
#Current versioning information from env
1414
BUILD_VERSION?="$(shell git describe --tags)"
15-
BUILD_GOVERSION="$(shell go version | cut -d " " -f3 | sed -r 's/[go]+//g')"
1615
BUILD_TIMESTAMP=$(shell date +%F"_"%T)
1716
BUILD_TAG="$(shell git rev-parse HEAD)"
1817
export LD_OPTS=-ldflags "-s -w -X github.com/crowdsecurity/cs-custom-bouncer/pkg/version.Version=$(BUILD_VERSION) \
1918
-X github.com/crowdsecurity/cs-custom-bouncer/pkg/version.BuildDate=$(BUILD_TIMESTAMP) \
20-
-X github.com/crowdsecurity/cs-custom-bouncer/pkg/version.Tag=$(BUILD_TAG) \
21-
-X github.com/crowdsecurity/cs-custom-bouncer/pkg/version.GoVersion=$(BUILD_GOVERSION)"
19+
-X github.com/crowdsecurity/cs-custom-bouncer/pkg/version.Tag=$(BUILD_TAG)"
2220

2321
RELDIR = "crowdsec-custom-bouncer-${BUILD_VERSION}"
2422

pkg/version/version.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package version
33
import (
44
"fmt"
55
"log"
6+
"runtime"
67
)
78

89
/*
@@ -21,7 +22,7 @@ var (
2122
Version string // = "v0.0.0"
2223
BuildDate string // = "I don't remember exactly"
2324
Tag string // = "dev"
24-
GoVersion string // = "1.13"
25+
GoVersion = runtime.Version() // = "1.13"
2526
)
2627

2728
func ShowStr() string {

0 commit comments

Comments
 (0)