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) }, }