From c8cde1492a5f79f7552cfdcc60e9bbaa4932b02b Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Tue, 29 Aug 2023 12:44:09 +0100 Subject: [PATCH] Ignore gofmt errors from vendor folder This started failing with Go 1.20, but I haven't been able to find out why yet, despite vendor being excluded from the list of packages/files to test. Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- Makefile | 14 +++++++------- go.sum | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 6b2b014f8..e87b1358e 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ build: .PHONY: gofmt gofmt: - @test -z $(shell gofmt -l -s $(SOURCE_DIRS) ./ | tee /dev/stderr) || (echo "[WARN] Fix formatting issues with 'make gofmt'" && exit 1) + @test -z $(shell gofmt -l -s $(SOURCE_DIRS) ./ |grep -v vendor/| tee /dev/stderr) || (echo "[WARN] Fix formatting issues with 'make gofmt'" && exit 1) .PHONY: test test: @@ -27,12 +27,12 @@ e2e: .PHONY: dist dist: mkdir -p bin - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -o bin/arkade - CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -o bin/arkade-darwin - CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/arkade-darwin-arm64 - CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags $(LDFLAGS) -o bin/arkade-armhf - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -o bin/arkade-arm64 - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags $(LDFLAGS) -o bin/arkade.exe + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -o bin/arkade + CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -o bin/arkade-darwin + CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -a -ldflags $(LDFLAGS) -o bin/arkade-darwin-arm64 + CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags $(LDFLAGS) -o bin/arkade-armhf + CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -o bin/arkade-arm64 + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags $(LDFLAGS) -o bin/arkade.exe .PHONY: hash hash: diff --git a/go.sum b/go.sum index 04a9be455..16ed64305 100644 --- a/go.sum +++ b/go.sum @@ -47,6 +47,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/magefile/mage v1.14.0 h1:6QDX3g6z1YvJ4olPhT1wksUcSa/V0a1B+pJb73fBjyo= +github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=