From 1b650f0a1e63da27145bde84e1a9dd126f721371 Mon Sep 17 00:00:00 2001 From: Joris Conijn Date: Tue, 19 Sep 2023 13:19:11 +0200 Subject: [PATCH] fix: passing version from version tag By using the version tags we can choice when to build a new release. However the `ldflags` where not passed correctly. --- .goreleaser.yaml | 2 ++ main.go | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 4c6fbcf..de48b33 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -16,6 +16,8 @@ builds: binary: aws-iam-user goos: ["linux", "darwin", "windows"] goarch: ["386", "amd64", "arm64"] + ldflags: + - -s -w -X "main.version={{.Version}}" env: - CGO_ENABLED=0 diff --git a/main.go b/main.go index 98ee43b..a3741db 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,8 @@ package main -import "github.com/conijnio/aws-iam-user/cmd" +import ( + "github.com/conijnio/aws-iam-user/cmd" +) var ( version = "dev"