[Makefile] Default to First Entry in `GOPATH` for `GOBIN` (#325)

jobatzil/rename
Johannes Batzill 2023-02-12 12:01:52 -08:00 committed by GitHub
parent 13a456e357
commit 3188c5757a
1 changed files with 3 additions and 3 deletions

View File

@ -1,8 +1,8 @@
ifndef GOPATH
GOPATH := $(shell go env GOPATH)
endif
ifndef GOBIN
GOBIN := $(shell go env GOPATH)/bin
ifndef GOBIN # derive value from gopath (default to first entry, similar to 'go get')
GOBIN := $(shell go env GOPATH | sed 's/:.*//')/bin
endif
ifndef DOCKER_BUILD_OPTS
DOCKER_BUILD_OPTS :=
@ -168,7 +168,7 @@ proto:
# Install golangci-lint
$(GOBIN)/golangci-lint:
@echo "🔘 Installing golangci-lint... (`date '+%H:%M:%S'`)"
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN)
# Install goimports to format code
$(GOBIN)/goimports: