diff --git a/internal/adminbootstrap/adminbootstrap.go b/internal/adminbootstrap/adminbootstrap.go index cc74561..01399ba 100644 --- a/internal/adminbootstrap/adminbootstrap.go +++ b/internal/adminbootstrap/adminbootstrap.go @@ -160,7 +160,7 @@ func (b Bootstrapper) userExists(ctx context.Context, username string) (bool, er if err != nil { return false, err } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() switch resp.StatusCode { case http.StatusOK: return true, nil @@ -185,7 +185,7 @@ func (b Bootstrapper) createUser(ctx context.Context, req Request, password stri if err != nil { return err } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() if resp.StatusCode/100 != 2 { return statusErr(resp) } @@ -199,7 +199,7 @@ func (b Bootstrapper) resetPassword(ctx context.Context, username, password stri if err != nil { return err } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() if resp.StatusCode/100 != 2 { return statusErr(resp) } @@ -226,7 +226,7 @@ func (b Bootstrapper) mintToken(ctx context.Context, username, password, tokenNa if err != nil { return "", err } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() if resp.StatusCode/100 != 2 { return "", statusErr(resp) } @@ -251,7 +251,7 @@ func (b Bootstrapper) grantReadAccess(ctx context.Context, r RepoRef, username s if err != nil { return err } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() if resp.StatusCode/100 != 2 { return statusErr(resp) }