Skip to content

Commit f678461

Browse files
committed
use assertion instead of errors.As
Signed-off-by: sivchari <shibuuuu5@gmail.com>
1 parent 3464653 commit f678461

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/clusterctl/client/repository/repository_github.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func (g *gitHubRepository) getVersions(ctx context.Context) ([]string, error) {
319319
if listReleasesErr != nil {
320320
retryError = g.handleGithubErr(listReleasesErr, "failed to get the list of releases")
321321
// Return immediately if we are rate limited.
322-
if errors.As(listReleasesErr, &rateLimitError) {
322+
if _, ok := listReleasesErr.(*github.RateLimitError); ok {
323323
return false, retryError
324324
}
325325
return false, nil
@@ -384,7 +384,7 @@ func (g *gitHubRepository) getReleaseByTag(ctx context.Context, tag string) (*gi
384384
return false, retryError
385385
}
386386
// Return immediately if we are rate limited.
387-
if errors.As(getReleasesErr, &rateLimitError) {
387+
if _, ok := getReleasesErr.(*github.RateLimitError); ok {
388388
return false, retryError
389389
}
390390
return false, nil

0 commit comments

Comments
 (0)