From 687edba2aed20d5c114f3c72dfbd96808531488f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sat, 8 Oct 2022 19:14:31 +0200 Subject: [PATCH] Fix vals version --- Makefile | 2 +- cmd/vals/main.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 700d1f8..67bef95 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ Version := $(shell git describe --tags --dirty) GitCommit := $(shell git rev-parse HEAD) -LDFLAGS := "-X main.Version=$(Version) -X main.GitCommit=$(GitCommit)" +LDFLAGS := "-X main.version=$(Version) -X main.commit=$(GitCommit)" build: go build -ldflags $(LDFLAGS) -o bin/vals ./cmd/vals diff --git a/cmd/vals/main.go b/cmd/vals/main.go index efe26e2..a815e77 100644 --- a/cmd/vals/main.go +++ b/cmd/vals/main.go @@ -13,8 +13,8 @@ import ( ) var ( - Version string - GitCommit string + version string + commit string ) func flagUsage() { @@ -162,12 +162,12 @@ func main() { } } case CmdVersion: - if len(Version) == 0 { + if len(version) == 0 { fmt.Println("Version: dev") } else { - fmt.Println("Version:", Version) + fmt.Println("Version:", version) } - fmt.Println("Git Commit:", GitCommit) + fmt.Println("Git Commit:", commit) default: flag.Usage() }