diff --git a/Makefile b/Makefile index 3a21711..43e2cbe 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DIST := dist EXECUTABLE := drone-ssh -GOFMT ?= gofmt "-s" +GOFMT ?= gofumpt -l -s GO ?= go # for dockerhub @@ -28,6 +28,9 @@ endif all: build fmt: + @hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ + $(GO) get -u mvdan.cc/gofumpt; \ + fi $(GOFMT) -w $(SOURCES) vet: @@ -55,6 +58,9 @@ misspell: .PHONY: fmt-check fmt-check: + @hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ + $(GO) get -u mvdan.cc/gofumpt; \ + fi @diff=$$($(GOFMT) -d $(SOURCES)); \ if [ -n "$$diff" ]; then \ echo "Please run 'make fmt' and commit the result:"; \ diff --git a/plugin_test.go b/plugin_test.go index 65956ee..bbf6ddf 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -387,9 +387,7 @@ func TestCommandOutput(t *testing.T) { } func TestWrongFingerprint(t *testing.T) { - var ( - buffer bytes.Buffer - ) + var buffer bytes.Buffer plugin := Plugin{ Config: Config{