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) } - } }