@@ -11,10 +11,10 @@ COVERAGE_PATH ?= coverage.txt
1111COVERAGE_ARGS ?= -covermode=atomic -coverprofile=$(COVERAGE_PATH )
1212TEST_ARGS ?= -race
1313
14- # Tool dependencies
15- TOOL_BIN_DIR ?= $( shell go env GOPATH) /bin
16- TOOL_GOLINT := $( TOOL_BIN_DIR ) /golint
17- TOOL_STATICCHECK := $( TOOL_BIN_DIR ) / staticcheck
14+ # 3rd party tools
15+ GOLINT := go run golang.org/x/lint/golint@latest
16+ REFLEX :=
go run github.com/cespare/[email protected] 17+ STATICCHECK := go run honnef.co/go/tools/cmd/ staticcheck@2023.1.3
1818
1919
2020# =============================================================================
@@ -58,11 +58,11 @@ testcover: testci
5858 go tool cover -html=$(COVERAGE_PATH )
5959.PHONY : testcover
6060
61- lint : $( TOOL_GOLINT ) $( TOOL_STATICCHECK )
61+ lint :
6262 test -z " $$ (gofmt -d -s -e .)" || (echo " Error: gofmt failed" ; gofmt -d -s -e . ; exit 1)
6363 go vet ./...
64- $(TOOL_GOLINT ) -set_exit_status ./...
65- $(TOOL_STATICCHECK ) ./...
64+ $(GOLINT ) -set_exit_status ./...
65+ $(STATICCHECK ) ./...
6666.PHONY : lint
6767
6868
@@ -73,8 +73,8 @@ run: build
7373 $(DIST_PATH ) /go-httpbin
7474.PHONY : run
7575
76- watch : $( TOOL_REFLEX )
77- reflex -s -r ' \.(go|html)$$' make run
76+ watch :
77+ $( REFLEX ) -s -r ' \.(go|html)$$' make run
7878.PHONY : watch
7979
8080
@@ -91,18 +91,3 @@ imagepush:
9191 docker buildx build --push --platform linux/amd64,linux/arm64 -t $(DOCKER_TAG ) .
9292 docker buildx rm httpbin
9393.PHONY : imagepush
94-
95-
96- # =============================================================================
97- # dependencies
98- #
99- # Deps are installed outside of working dir to avoid polluting go modules
100- # =============================================================================
101- $(TOOL_GOLINT ) :
102- go install golang.org/x/lint/golint@latest
103-
104- $(TOOL_REFLEX ) :
105- go install github.com/cespare/
[email protected] 106-
107- $(TOOL_STATICCHECK ) :
108- go install honnef.co/go/tools/cmd/
[email protected]
0 commit comments