Skip to content

Commit 161789f

Browse files
committed
ic: aws: fix linting errors in basedomain
* Don't use capitalized error messages * Use errors.As to unwrap a specific error type
1 parent cb64dfb commit 161789f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/asset/installconfig/aws/basedomain.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
// IsForbidden returns true if and only if the input error is an HTTP
2020
// 403 error from the AWS API.
2121
func IsForbidden(err error) bool {
22-
requestError, ok := err.(awserr.RequestFailure)
23-
return ok && requestError.StatusCode() == http.StatusForbidden
22+
var requestError awserr.RequestFailure
23+
return errors.As(err, &requestError) && requestError.StatusCode() == http.StatusForbidden
2424
}
2525

2626
// GetBaseDomain returns a base domain chosen from among the account's
@@ -99,7 +99,7 @@ func GetPublicZone(sess *session.Session, name string) (*route53.HostedZone, err
9999
return nil, fmt.Errorf("listing hosted zones: %w", err)
100100
}
101101
if res == nil {
102-
return nil, fmt.Errorf("No public route53 zone found matching name %q", name)
102+
return nil, fmt.Errorf("no public route53 zone found matching name %q", name)
103103
}
104104
return res, nil
105105
}

0 commit comments

Comments
 (0)