From 84ae42bcde701accec62877cf26cce642cc13132 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Wed, 9 Sep 2020 23:28:59 -0700 Subject: [PATCH] golangci: enable additional checks --- .github/workflows/linter.yml | 3 --- .golangci.yml | 6 ++++++ data_test.go | 1 - imageproxy.go | 2 +- imageproxy_test.go | 1 - 5 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 .golangci.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 8ea3caa..c82a70d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -16,6 +16,3 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: v1.31 - - - name: Run go fmt - run: diff -u <(echo -n) <(gofmt -d -s .) diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..f20add9 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,6 @@ +linters: + enable: + - goimports + - stylecheck + - misspell + - whitespace diff --git a/data_test.go b/data_test.go index 633e329..7c75753 100644 --- a/data_test.go +++ b/data_test.go @@ -209,5 +209,4 @@ func TestNewRequest_BaseURL(t *testing.T) { if got := r.String(); got != want { t.Errorf("NewRequest(%v, %v) returned %q, want %q", req, base, got, want) } - } diff --git a/imageproxy.go b/imageproxy.go index 6ffb993..a2f4d22 100644 --- a/imageproxy.go +++ b/imageproxy.go @@ -230,7 +230,7 @@ func (p *Proxy) serveImage(w http.ResponseWriter, r *http.Request) { copyHeader(w.Header(), resp.Header, "Content-Length") - //Enable CORS for 3rd party applications + // Enable CORS for 3rd party applications w.Header().Set("Access-Control-Allow-Origin", "*") w.WriteHeader(resp.StatusCode) diff --git a/imageproxy_test.go b/imageproxy_test.go index bbbc6f4..7afc381 100644 --- a/imageproxy_test.go +++ b/imageproxy_test.go @@ -110,7 +110,6 @@ func TestCopyHeader(t *testing.T) { if !reflect.DeepEqual(got, tt.want) { t.Errorf("copyHeader(%v, %v, %v) returned %v, want %v", tt.dst, tt.src, tt.keys, got, tt.want) } - } }