Skip to content

Commit 32e3b63

Browse files
pbeckhamclaude
andcommitted
chore(controls): check resp.Body.Close in openapi contract test
Satisfy the errcheck linter by handling the deferred Body.Close return value. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 16cf990 commit 32e3b63

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cmd/kosli/openapiContract_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type driftCase struct {
5656
func (suite *OpenAPIContractTestSuite) SetupSuite() {
5757
resp, err := http.Get("http://localhost:8001/api/v2/openapi.json")
5858
require.NoError(suite.T(), err, "should fetch the OpenAPI schema from the test server")
59-
defer resp.Body.Close()
59+
defer func() { _ = resp.Body.Close() }()
6060
body, err := io.ReadAll(resp.Body)
6161
require.NoError(suite.T(), err)
6262
require.NoError(suite.T(), json.Unmarshal(body, &suite.schema), "OpenAPI schema should be valid JSON")

0 commit comments

Comments
 (0)