mirror of
https://github.com/bloomberg/goldpinger.git
synced 2026-08-23 21:36:25 +00:00
inject build info into main during build process
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
This commit is contained in:
+3
-2
@@ -37,5 +37,6 @@ export CGO_ENABLED=0
|
||||
export GOARCH="${ARCH}"
|
||||
|
||||
go build \
|
||||
-o ./bin/${BIN} \
|
||||
./cmd/${BIN}
|
||||
-ldflags "-X 'main.Version=${VERSION}' -X 'main.Build=`date`'" \
|
||||
-o ./bin/${BIN} \
|
||||
./cmd/${BIN}
|
||||
|
||||
@@ -29,7 +29,15 @@ import (
|
||||
flags "github.com/jessevdk/go-flags"
|
||||
)
|
||||
|
||||
// these will be injected during build in build.sh script to allow printing
|
||||
var (
|
||||
Version, Build string
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
log.Println("Goldpinger version:", Version, "build:", Build)
|
||||
|
||||
// load embedded swagger file
|
||||
swaggerSpec, err := loads.Analyzed(restapi.SwaggerJSON, "")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user