From 4475f8548de5614b0493104c2062a584586dfb51 Mon Sep 17 00:00:00 2001 From: Sukhjit Singh Date: Wed, 15 Dec 2021 17:25:00 +1100 Subject: [PATCH] Conditional install of linter. Make command for "test" --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 65f2212..b39fe99 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,13 @@ GOBIN=$(shell pwd)/bin install-lint: - @curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.42.0 + @if [ ! -f "$(GOBIN)/golangci-lint" ]; then \ + curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.42.0; \ + fi lint: install-lint @echo "golangci-lint run ../..." @$(GOBIN)/golangci-lint run ./... + +test: + go test -race -failfast ./...