diff --git a/.golangci.yml b/.golangci.yml index 5c7862ff5..0b6333297 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,6 +5,7 @@ linters: disable-all: true enable: - deadcode + - errcheck - errorlint - goconst - gocyclo @@ -16,12 +17,15 @@ linters: - ineffassign - misspell - nakedret + - nilerr - prealloc - revive - staticcheck - structcheck + - typecheck - unconvert - unused - varcheck + - whitespace # Run with --fast=false for more extensive checks fast: true diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index 62897c8ab..9cda9560d 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -57,7 +57,7 @@ func (p *proxy) writeResponse(w http.ResponseWriter, res *http.Response) { // Set a special header to notify that the proxy actually serviced the request. w.Header().Set("Server", "pi-sidecar-proxy") w.WriteHeader(res.StatusCode) - io.Copy(w, res.Body) + _, _ = io.Copy(w, res.Body) res.Body.Close() klog.InfoS("request complete", "status", res.StatusCode) diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go index 7036c831a..e4523350b 100644 --- a/cmd/webhook/main.go +++ b/cmd/webhook/main.go @@ -61,7 +61,6 @@ func init() { } func main() { - // TODO (aramase) once webhook is added as an arc extension, use extension // util to check if running in arc cluster. flag.BoolVar(&arcCluster, "arc-cluster", false, "Running on arc cluster")