inject build info into main during build process

Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
This commit is contained in:
Mikolaj Pawlikowski
2018-12-06 16:31:14 +00:00
parent 4c82b29025
commit b90ebe4d19
2 changed files with 11 additions and 2 deletions

View File

@@ -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 {