@@ -120,12 +120,12 @@ func TestRunAPIImportOAS_WithFile(t *testing.T) {
120120 if r .Method == http .MethodPost && strings .Contains (r .URL .Path , "/api/apis/oas" ) {
121121 // Simulate API creation
122122 createResp := mockCreateAPIResponse ()
123- json .NewEncoder (w ).Encode (createResp )
123+ _ = json .NewEncoder (w ).Encode (createResp )
124124 } else if r .Method == http .MethodGet && strings .Contains (r .URL .Path , "/api/apis/oas/new-api-456" ) {
125125 // Simulate getting the created API details
126126 api := mockCreatedOASAPI ()
127127 // Return the OAS document directly as the API endpoint does
128- json .NewEncoder (w ).Encode (api .OAS )
128+ _ = json .NewEncoder (w ).Encode (api .OAS )
129129 }
130130 }))
131131 defer server .Close ()
@@ -146,7 +146,7 @@ func TestRunAPIImportOAS_WithFile(t *testing.T) {
146146 cmd .SetContext (withOutputFormat (cmd .Context (), types .OutputJSON ))
147147
148148 // Set flags
149- cmd .Flags ().Set ("file" , tmpFile )
149+ _ = cmd .Flags ().Set ("file" , tmpFile )
150150
151151 // Execute command
152152 err := cmd .Execute ()
@@ -184,8 +184,8 @@ func TestRunAPIImportOAS_BothInputs(t *testing.T) {
184184 cmd .SetContext (withConfig (context .Background (), config ))
185185
186186 // Set both file and url flags
187- cmd .Flags ().Set ("file" , "/tmp/test.yaml" )
188- cmd .Flags ().Set ("url" , "https://example.com/api.yaml" )
187+ _ = cmd .Flags ().Set ("file" , "/tmp/test.yaml" )
188+ _ = cmd .Flags ().Set ("url" , "https://example.com/api.yaml" )
189189
190190 err := cmd .Execute ()
191191
@@ -216,11 +216,11 @@ func TestRunAPIUpdateOAS_Success(t *testing.T) {
216216 // Simulate getting existing API
217217 existingAPI := mockCreatedOASAPI ()
218218 existingAPI .ID = testAPIID
219- json .NewEncoder (w ).Encode (existingAPI .OAS )
219+ _ = json .NewEncoder (w ).Encode (existingAPI .OAS )
220220 } else if r .Method == http .MethodPut && strings .Contains (r .URL .Path , testAPIID ) {
221221 // Simulate API update
222222 updateResp := types.APIResponse {ID : testAPIID , Message : "Updated" }
223- json .NewEncoder (w ).Encode (updateResp )
223+ _ = json .NewEncoder (w ).Encode (updateResp )
224224 }
225225 }))
226226 defer server .Close ()
@@ -242,7 +242,7 @@ func TestRunAPIUpdateOAS_Success(t *testing.T) {
242242
243243 // Set args and flags
244244 cmd .SetArgs ([]string {testAPIID })
245- cmd .Flags ().Set ("file" , tmpFile )
245+ _ = cmd .Flags ().Set ("file" , tmpFile )
246246
247247 // Execute command
248248 err := cmd .Execute ()
@@ -299,7 +299,7 @@ func TestRunAPIApply_PlainOASRejection(t *testing.T) {
299299 cmd .SetContext (withConfig (context .Background (), config ))
300300
301301 // Set file flag
302- cmd .Flags ().Set ("file" , tmpFile )
302+ _ = cmd .Flags ().Set ("file" , tmpFile )
303303
304304 // Execute command
305305 err := cmd .Execute ()
@@ -326,12 +326,12 @@ func TestRunAPIApply_MissingIDCreatesAPI(t *testing.T) {
326326 server := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
327327 if r .Method == http .MethodPost && strings .Contains (r .URL .Path , "/api/apis/oas" ) {
328328 createResp := mockCreateAPIResponse ()
329- json .NewEncoder (w ).Encode (createResp )
329+ _ = json .NewEncoder (w ).Encode (createResp )
330330 return
331331 }
332332 if r .Method == http .MethodGet && strings .Contains (r .URL .Path , "/api/apis/oas/new-api-456" ) {
333333 api := mockCreatedOASAPI ()
334- json .NewEncoder (w ).Encode (api .OAS )
334+ _ = json .NewEncoder (w ).Encode (api .OAS )
335335 return
336336 }
337337 http .NotFound (w , r )
@@ -347,7 +347,7 @@ func TestRunAPIApply_MissingIDCreatesAPI(t *testing.T) {
347347 }
348348 cmd .SetContext (withConfig (context .Background (), config ))
349349
350- cmd .Flags ().Set ("file" , tmpFile )
350+ _ = cmd .Flags ().Set ("file" , tmpFile )
351351
352352 // Execute command: should succeed and create new API
353353 err := cmd .Execute ()
@@ -382,7 +382,7 @@ func TestLoadOASFromURL_Success(t *testing.T) {
382382 testOAS := mockCleanOAS ()
383383 server := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
384384 w .Header ().Set ("Content-Type" , "application/json" )
385- json .NewEncoder (w ).Encode (testOAS )
385+ _ = json .NewEncoder (w ).Encode (testOAS )
386386 }))
387387 defer server .Close ()
388388
@@ -413,7 +413,7 @@ func TestLoadOASFromURL_HTTPError(t *testing.T) {
413413func TestLoadOASFromURL_InvalidJSON (t * testing.T ) {
414414 // Create a test server that returns invalid JSON
415415 server := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
416- w .Write ([]byte ("invalid json content" ))
416+ _ , _ = w .Write ([]byte ("invalid json content" ))
417417 }))
418418 defer server .Close ()
419419
0 commit comments