Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update errcheck linter configuration and fix errors #483

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions internal/mux/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down