lint: fix errcheck for Close and Write calls across multiple files
Use lint.LogOnErr for deferred Body/File/Client Close calls. Use lint.Write for unchecked w.Write calls. Fix bug in sync/sms.go where fmt.Errorf result was discarded (replace with proper log.Error call).
This commit is contained in:
parent
c7a7e8431c
commit
0ec810591e
9 changed files with 24 additions and 15 deletions
|
|
@ -52,7 +52,7 @@ func (c *Client) GetUser(userID int) (*User, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to GET /api/users/%d: %w", userID, err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer lint.LogOnErr(resp.Body.Close, "close response body")
|
||||
|
||||
// Parse response
|
||||
var user User
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue