From 9d3d0f2552ed16e1204a38049aff4056adc3172e Mon Sep 17 00:00:00 2001 From: Alessio Greggi Date: Mon, 22 Apr 2024 22:22:27 +0200 Subject: [PATCH] fix: restore version Signed-off-by: Alessio Greggi --- Makefile | 2 +- cmd/version.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c9ec7fb..5b6bcda 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ endif go build \ -tags core,ebpf \ -v \ - -ldflags="-s -w -X 'main.version=${GITHUB_REF_NAME}'" \ + -ldflags="-s -w -X 'github.com/alegrey91/harpoon/cmd.Version=${GITHUB_REF_NAME}'" \ -o ${BINARY_DIR}/${BINARY_NAME} \ . diff --git a/cmd/version.go b/cmd/version.go index dffae61..14509e9 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -21,14 +21,14 @@ import ( "github.com/spf13/cobra" ) -var version = "test" +var Version = "test" // captureCmd represents the create args var versionCmd = &cobra.Command{ Use: "version", Short: "Version of the tool.", Run: func(cmd *cobra.Command, args []string) { - fmt.Println(version) + fmt.Println(Version) }, }