Skip to content

Commit

Permalink
switch the golangci install method (#86)
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Sch <[email protected]>
  • Loading branch information
SchSeba authored Jun 3, 2024
1 parent 3d6a050 commit 95e96ac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ GOLANGCI_LINT = $(BINDIR)/golangci-lint
# in case of a version bump
GOLANGCI_LINT_VER = v1.51.2
TIMEOUT = 15
export GOLANGCI_LINT_CACHE = $(BUILDDIR)/.cache

$(GOLANGCI_LINT): | $(BINDIR) ; $(info installing golangci-lint...)
$Q GOBIN=$(BINDIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VER)
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VER))

GOVERALLS = $(BINDIR)/goveralls
$(GOVERALLS): | $(BINDIR) ; $(info installing goveralls...)
Expand Down Expand Up @@ -158,3 +160,12 @@ rm -r $(1)/shellcheck*/;\
rm $(1)/shellcheck.tar.xz;\
}
endef

# go-install-tool will 'go install' any package $2 and install it to $1.
define go-install-tool
@[ -f $(1) ] || { \
set -e ;\
echo "Downloading $(2)" ;\
GOBIN=$(BINDIR) go install -mod=mod $(2) ;\
}
endef

0 comments on commit 95e96ac

Please sign in to comment.