Add new linter: makezero (#497)

I think this fixed a bug where pkg.RunScorecards was being run for empty repoURLs

Co-authored-by: Azeem Shaikh <azeemshaikh38@gmail.com>
This commit is contained in:
Chris McGehee 2021-05-24 11:19:37 -07:00 committed by GitHub
parent a89eedc471
commit 2d9a23b4bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -40,6 +40,7 @@ linters:
- govet
- ineffassign
- lll
- makezero
- misspell
- nakedret
- nestif

View File

@ -39,7 +39,7 @@ import (
func processRequest(ctx context.Context,
batchRequest *data.ScorecardBatchRequest, bucketURL string,
httpClient *http.Client, githubClient *github.Client, graphClient *githubv4.Client) error {
repoURLs := make([]repos.RepoURL, len(batchRequest.GetRepos()))
repoURLs := make([]repos.RepoURL, 0, len(batchRequest.GetRepos()))
var resultCh chan repos.RepoResult
var buffer bytes.Buffer