Check error type instead of value (#592)

Co-authored-by: Azeem Shaikh <azeems@google.com>
This commit is contained in:
Azeem Shaikh 2021-06-20 12:31:51 -07:00 committed by GitHub
parent db02490da4
commit bfe0169326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,8 +84,8 @@ func RunScorecards(ctx context.Context,
}
defer logStats(ctx, time.Now())
var e clients.ErrRepoUnavailable
if err := repoClient.InitRepo(repo.Owner, repo.Repo); errors.Is(err, &e) {
var e *clients.ErrRepoUnavailable
if err := repoClient.InitRepo(repo.Owner, repo.Repo); errors.As(err, &e) {
// Unable to access repo URL. Continue.
log.Printf("%s: %v", repo.URL(), err)
return repos.RepoResult{