From 727bb58911a1116b01adc3e8fb192b18c896d8a7 Mon Sep 17 00:00:00 2001 From: Chris McGehee Date: Tue, 11 May 2021 06:52:52 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B1=20Fix=20lint=20issues:=20govet=20l?= =?UTF-8?q?inter=20(#395)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix lint issues: govet linter The fieldalignment analyzer informs you when structs would take up less memory with their fields reordered. * CheckResult.Details was not omitted as intended Found by govet linter * Removing possible breaking change Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com> Co-authored-by: Azeem Shaikh --- checker/check_request.go | 2 +- checker/check_result.go | 8 ++++---- e2e/executable_test.go | 4 ++-- roundtripper/roundtripper.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/checker/check_request.go b/checker/check_request.go index 611e1e37..cc8fe7c0 100644 --- a/checker/check_request.go +++ b/checker/check_request.go @@ -27,6 +27,6 @@ type CheckRequest struct { Client *github.Client GraphClient *githubv4.Client HTTPClient *http.Client - Owner, Repo string Logf func(s string, f ...interface{}) + Owner, Repo string } diff --git a/checker/check_result.go b/checker/check_result.go index 5af2c7ab..48ec7061 100644 --- a/checker/check_result.go +++ b/checker/check_result.go @@ -17,12 +17,12 @@ package checker const MaxResultConfidence = 10 type CheckResult struct { + Error error `json:"-"` Name string - Pass bool + Details []string Confidence int - Details []string `json:omitempty` - ShouldRetry bool `json:"-"` - Error error `json:"-"` + Pass bool + ShouldRetry bool `json:"-"` } func MakeInconclusiveResult(name string) CheckResult { diff --git a/e2e/executable_test.go b/e2e/executable_test.go index aef4ae8f..a3158d0b 100644 --- a/e2e/executable_test.go +++ b/e2e/executable_test.go @@ -27,9 +27,9 @@ type scorecard struct { Date string `json:"Date"` Checks []struct { CheckName string `json:"CheckName"` - Pass bool `json:"Pass"` - Confidence int `json:"Confidence"` Details []string `json:"Details"` + Confidence int `json:"Confidence"` + Pass bool `json:"Pass"` } `json:"Checks"` MetaData []string `json:"MetaData"` } diff --git a/roundtripper/roundtripper.go b/roundtripper/roundtripper.go index 0bc9da08..b278f5bd 100644 --- a/roundtripper/roundtripper.go +++ b/roundtripper/roundtripper.go @@ -53,8 +53,8 @@ type RateLimitRoundTripper struct { } type RoundRobinTokenSource struct { - AccessTokens []string log *zap.SugaredLogger + AccessTokens []string } func (r *RoundRobinTokenSource) Token() (*oauth2.Token, error) {