chore(makefile): change gofmt toll to gofumpt

This commit is contained in:
Bo-Yi Wu 2021-01-12 00:54:00 +08:00
parent 5750d46265
commit 6850ed1bff
2 changed files with 8 additions and 4 deletions

View File

@ -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:"; \

View File

@ -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{