Skip to content

Commit

Permalink
Read Go version from go.mod (#162)
Browse files Browse the repository at this point in the history
Signed-off-by: Faisal Memon <fymemon@yahoo.com>
Co-authored-by: Marcos Yacob <marcos.yacob@hpe.com>
  • Loading branch information
faisal-memon and MarcosDY authored Jun 24, 2024
1 parent 48cba65 commit 022da13
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion .go-version

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ endif

build_dir := $(DIR)/.build/$(os1)-$(arch1)

go_version := $(shell cat .go-version)
go_version := $(shell sed -En 's/^go[ ]+([0-9.]+).*/\1/p' go.mod)
go_dir := $(build_dir)/go/$(go_version)
ifeq ($(os1),windows)
go_bin_dir = $(go_dir)/go/bin
@@ -157,7 +157,7 @@ endif

.PHONY: tidy tidy-check lint lint-code
tidy: | go-check
$(E)$(go_path) mod tidy
$(E)$(go_path) go mod tidy

tidy-check:
ifneq ($(git_dirty),)
@@ -180,7 +180,7 @@ lint-code: $(golangci_lint_bin) | go-check
.PHONY: build test clean distclean artifact tarball rpm docker-build container-builder load-images

build: | go-check
CGO_ENABLED=0 go build -o spiffe-helper${exe} ./cmd/spiffe-helper
$(E)CGO_ENABLED=0 $(go_path) go build -o spiffe-helper${exe} ./cmd/spiffe-helper

docker-build: $(addsuffix -image.tar, spiffe-helper) ## Build docker image with spiffe-helper.

0 comments on commit 022da13

Please sign in to comment.