Skip to content

Commit

Permalink
Enable bodyclose linter (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
bschimke95 authored Oct 15, 2024
1 parent c618f09 commit 8c0f665
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ linters:
disable-all: true
enable:
- gosimple
- asasalint
- asciicheck
- bidichk
- bodyclose

# TODO(ben): Enable those linters step by step and fix existing issues.
# - errcheck
# - govet
# - ineffassign
# - staticcheck
# - unused
# - asasalint
# - asciicheck
# - bidichk
# - bodyclose
# - canonicalheader
# - containedctx
# - contextcheck
Expand All @@ -33,6 +28,7 @@ linters:
# - dupword
# - durationcheck
# - err113
# - errcheck
# - errchkjson
# - errname
# - errorlint
Expand Down Expand Up @@ -63,9 +59,11 @@ linters:
# - goprintffuncname
# - gosec
# - gosmopolitan
# - govet
# - grouper
# - importas
# - inamedparam
# - ineffassign
# - interfacebloat
# - intrange
# - ireturn
Expand Down Expand Up @@ -98,6 +96,7 @@ linters:
# - sloglint
# - spancheck
# - sqlclosecheck
# - staticcheck
# - stylecheck
# - tagalign
# - tagliatelle
Expand All @@ -109,6 +108,7 @@ linters:
# - tparallel
# - unconvert
# - unparam
# - unused
# - usestdlibvars
# - varnamelen
# - wastedassign
Expand Down
1 change: 1 addition & 0 deletions src/k8s/pkg/client/snapd/refresh_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func (c *Client) GetRefreshStatus(changeID string) (*types.RefreshStatus, error)
if err != nil {
return nil, fmt.Errorf("failed to get snapd change status: %w", err)
}
defer resp.Body.Close()

resBody, err := io.ReadAll(resp.Body)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions src/k8s/pkg/utils/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func GetRemoteCertificate(address string) (*x509.Certificate, error) {
if err != nil {
return nil, err
}
defer resp.Body.Close()

// Retrieve the certificate
if resp.TLS == nil || len(resp.TLS.PeerCertificates) == 0 {
Expand Down

0 comments on commit 8c0f665

Please sign in to comment.