Skip to content

Commit 793e1c5

Browse files
fix(fleetcontrol): properly handle Body.Close() error in defer
Address errcheck lint error by explicitly ignoring the Close() error in deferred function call.
1 parent f2a6e03 commit 793e1c5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/fleetcontrol/fleetcontrol_configurations.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ func (a *Fleetcontrol) FleetControlGetConfigurationWithContext(
8484
if err != nil {
8585
return nil, fmt.Errorf("failed to make request: %w", err)
8686
}
87-
defer httpResp.Body.Close()
87+
defer func() {
88+
_ = httpResp.Body.Close()
89+
}()
8890

8991
// Check for error status codes
9092
if httpResp.StatusCode != http.StatusOK {
@@ -199,7 +201,7 @@ type CreateConfigurationResponse struct {
199201

200202
type GetConfigurationResponse string
201203

202-
type GetConfigurationVersionsResponse struct{
204+
type GetConfigurationVersionsResponse struct {
203205
Versions []ConfigurationVersion `json:"versions"`
204206
Cursor *string `json:"cursor"`
205207
}

0 commit comments

Comments
 (0)