Skip to content

Commit a653460

Browse files
committed
Fix nil resp on error
1 parent 3156d50 commit a653460

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ func validateSpecFile(filename string) []int {
143143
// Send request
144144
fmt.Println("\nURL:", req.URL)
145145
resp, e := NoCacheClient.Do(req)
146-
resp.Body.Close()
147146
if e != nil {
148147
fmt.Printf("ERROR: Failed to request: %v\n", e)
149148
errorCodes = append(errorCodes, FailedRequest)
150149
break
151150
}
151+
resp.Body.Close()
152152

153153
// Validate response headers
154154
expectedHeaders := clone(defaultSpec.ResponseHeaders,

0 commit comments

Comments
 (0)