Skip to content

Commit

Permalink
return closing err unless it already failed
Browse files Browse the repository at this point in the history
  • Loading branch information
dangra committed Mar 1, 2023
1 parent 6a8283d commit c2f3440
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ func GetAccessToken(ctx context.Context, email, password, otp string) (token str
return
}
defer func() {
err := res.Body.Close()
if err != nil {
fmt.Println("Error closing response body: %v", err)
closeErr := res.Body.Close()
if err == nil {
err = closeErr
}
}()

Expand Down

0 comments on commit c2f3440

Please sign in to comment.