diff --git a/.golangci.yaml b/.golangci.yaml index 791f574f..a983c508 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -19,6 +19,10 @@ linters: - perfsprint - gocritic linters-settings: + errcheck: + check-type-assertions: true + check-blank: true + disable-default-exclusions: true govet: enable-all: true disable: diff --git a/CHANGELOG.md b/CHANGELOG.md index 272a1e82..bc806dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#480](https://github.com/XenitAB/spegel/pull/480) Enable ireturn linter and fix errors. - [#481](https://github.com/XenitAB/spegel/pull/481) Enable perfsprint linter and fix errors. - [#482](https://github.com/XenitAB/spegel/pull/482) Enable gocritic linter and fix errors. +- [#483](https://github.com/XenitAB/spegel/pull/483) Update errcheck linter configuration and fix errors. ### Deprecated diff --git a/internal/mux/response.go b/internal/mux/response.go index 50593c95..6b1ce906 100644 --- a/internal/mux/response.go +++ b/internal/mux/response.go @@ -52,11 +52,13 @@ func (r *response) WriteError(statusCode int, err error) { func (r *response) Flush() { r.writtenHeader = true + //nolint: errcheck // No method to throw the error. flusher := r.ResponseWriter.(http.Flusher) flusher.Flush() } func (r *response) Hijack() (net.Conn, *bufio.ReadWriter, error) { + //nolint: errcheck // No method to throw the error. hijacker := r.ResponseWriter.(http.Hijacker) return hijacker.Hijack() }