From 61ecad31514dfb6e13650a4620103a2f7d51b126 Mon Sep 17 00:00:00 2001 From: Chris McGehee Date: Sun, 23 May 2021 20:51:52 -0700 Subject: [PATCH] Add new linter: gci (#498) --- .golangci.yml | 5 +++++ checker/check_runner.go | 3 ++- checks/active.go | 1 + checks/branch_protected.go | 1 + checks/branch_protected_test.go | 1 + checks/ci_tests.go | 1 + checks/code_review.go | 1 + checks/contributors.go | 1 + checks/frozen_deps.go | 3 ++- checks/fuzzing.go | 1 + checks/packaging.go | 1 + checks/pull_requests.go | 1 + checks/sast.go | 1 + checks/signed_releases.go | 1 + checks/signed_tags.go | 3 ++- cmd/root.go | 10 +++++----- cmd/serve.go | 7 ++++--- cron/bq/transfer.go | 1 + cron/config/config.go | 4 +++- cron/controller/main.go | 3 ++- cron/data/blob.go | 7 +++++-- cron/data/iterator.go | 1 + cron/main.go | 7 ++++--- cron/monitoring/exporter.go | 1 + cron/pubsub/publisher.go | 7 +++++-- cron/pubsub/publisher_test.go | 3 ++- cron/pubsub/subscriber.go | 7 +++++-- cron/pubsub/subscriber_test.go | 3 ++- cron/worker/main.go | 5 +++-- e2e/active_test.go | 1 + e2e/blob_test.go | 1 + e2e/branchprotection_test.go | 1 + e2e/ci_tests_test.go | 1 + e2e/cii_best_practices_test.go | 1 + e2e/code_review_test.go | 1 + e2e/contributors_test.go | 1 + e2e/e2e_suite_test.go | 3 ++- e2e/frozen_deps_test.go | 1 + e2e/fuzzing_test.go | 1 + e2e/packaging_test.go | 1 + e2e/pull_requests_test.go | 1 + e2e/sast_test.go | 1 + e2e/security_policy_test.go | 1 + e2e/signedreleases_test.go | 1 + gitcache/e2e/e2e_bucketcache_test.go | 1 + gitcache/e2e/e2e_http_test.go | 1 + gitcache/main.go | 3 ++- pkg/scorecard.go | 3 ++- roundtripper/census.go | 3 ++- roundtripper/rate_limit.go | 3 ++- 50 files changed, 91 insertions(+), 31 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 3290ed36..60fc158a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,6 +4,8 @@ run: deadline: 5m issues: new-from-rev: "" +skip-files: + - cron/data/request.pb.go # autogenerated linters: disable-all: true enable: @@ -16,6 +18,7 @@ linters: - errcheck - exhaustive - exportloopref + - gci - gochecknoinits - gocognit - goconst @@ -71,6 +74,8 @@ linters-settings: - BUG - FIXME - HACK + gci: + local-prefixes: github.com/ossf/scorecard gocritic: enabled-checks: # Diagnostic diff --git a/checker/check_runner.go b/checker/check_runner.go index c069a1ce..fa43a3ba 100644 --- a/checker/check_runner.go +++ b/checker/check_runner.go @@ -20,9 +20,10 @@ import ( "strings" "time" - "github.com/ossf/scorecard/stats" opencensusstats "go.opencensus.io/stats" "go.opencensus.io/tag" + + "github.com/ossf/scorecard/stats" ) const checkRetries = 3 diff --git a/checks/active.go b/checks/active.go index 21aeb3a9..747e8b16 100644 --- a/checks/active.go +++ b/checks/active.go @@ -18,6 +18,7 @@ import ( "time" "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/branch_protected.go b/checks/branch_protected.go index c84551e5..b3f5d57a 100644 --- a/checks/branch_protected.go +++ b/checks/branch_protected.go @@ -16,6 +16,7 @@ package checks import ( "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/branch_protected_test.go b/checks/branch_protected_test.go index 4cac54e4..19970321 100644 --- a/checks/branch_protected_test.go +++ b/checks/branch_protected_test.go @@ -19,6 +19,7 @@ import ( "testing" "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/ci_tests.go b/checks/ci_tests.go index f1c61f7b..cf3879f2 100644 --- a/checks/ci_tests.go +++ b/checks/ci_tests.go @@ -19,6 +19,7 @@ import ( "strings" "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/code_review.go b/checks/code_review.go index 3d4013a9..c0285676 100644 --- a/checks/code_review.go +++ b/checks/code_review.go @@ -19,6 +19,7 @@ import ( "strings" "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/contributors.go b/checks/contributors.go index 043cf2ec..92f5019f 100644 --- a/checks/contributors.go +++ b/checks/contributors.go @@ -18,6 +18,7 @@ import ( "strings" "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/frozen_deps.go b/checks/frozen_deps.go index c533c07e..f9c647b4 100644 --- a/checks/frozen_deps.go +++ b/checks/frozen_deps.go @@ -21,8 +21,9 @@ import ( "strings" "github.com/moby/buildkit/frontend/dockerfile/parser" - "github.com/ossf/scorecard/checker" "gopkg.in/yaml.v2" + + "github.com/ossf/scorecard/checker" ) const frozenDepsStr = "Frozen-Deps" diff --git a/checks/fuzzing.go b/checks/fuzzing.go index c67de8c2..2421393f 100644 --- a/checks/fuzzing.go +++ b/checks/fuzzing.go @@ -18,6 +18,7 @@ import ( "fmt" "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/packaging.go b/checks/packaging.go index 94667722..bf4a3e2f 100644 --- a/checks/packaging.go +++ b/checks/packaging.go @@ -20,6 +20,7 @@ import ( "strings" "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/pull_requests.go b/checks/pull_requests.go index 17adf452..0a503fcf 100644 --- a/checks/pull_requests.go +++ b/checks/pull_requests.go @@ -18,6 +18,7 @@ import ( "strings" "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/sast.go b/checks/sast.go index 45eb8e7b..90ba9590 100644 --- a/checks/sast.go +++ b/checks/sast.go @@ -18,6 +18,7 @@ import ( "errors" "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/signed_releases.go b/checks/signed_releases.go index dc772077..95c8e15e 100644 --- a/checks/signed_releases.go +++ b/checks/signed_releases.go @@ -19,6 +19,7 @@ import ( "strings" "github.com/google/go-github/v32/github" + "github.com/ossf/scorecard/checker" ) diff --git a/checks/signed_tags.go b/checks/signed_tags.go index 95695a58..f121008a 100644 --- a/checks/signed_tags.go +++ b/checks/signed_tags.go @@ -17,8 +17,9 @@ package checks import ( "errors" - "github.com/ossf/scorecard/checker" "github.com/shurcooL/githubv4" + + "github.com/ossf/scorecard/checker" ) const ( diff --git a/cmd/root.go b/cmd/root.go index 622a171d..97961935 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -18,6 +18,7 @@ import ( "context" "encoding/json" "errors" + goflag "flag" "fmt" "log" "net/http" @@ -26,17 +27,16 @@ import ( "strings" "time" - goflag "flag" - "github.com/google/go-github/v32/github" + "github.com/shurcooL/githubv4" + "github.com/spf13/cobra" + "go.uber.org/zap" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" "github.com/ossf/scorecard/pkg" "github.com/ossf/scorecard/repos" "github.com/ossf/scorecard/roundtripper" - "github.com/shurcooL/githubv4" - "github.com/spf13/cobra" - "go.uber.org/zap" ) var ( diff --git a/cmd/serve.go b/cmd/serve.go index 1884ce09..df295452 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -23,13 +23,14 @@ import ( "strings" "github.com/google/go-github/v32/github" + "github.com/shurcooL/githubv4" + "github.com/spf13/cobra" + "go.uber.org/zap" + "github.com/ossf/scorecard/checks" "github.com/ossf/scorecard/pkg" "github.com/ossf/scorecard/repos" "github.com/ossf/scorecard/roundtripper" - "github.com/shurcooL/githubv4" - "github.com/spf13/cobra" - "go.uber.org/zap" ) //nolint:gochecknoinits diff --git a/cron/bq/transfer.go b/cron/bq/transfer.go index e17d948f..d98f8123 100644 --- a/cron/bq/transfer.go +++ b/cron/bq/transfer.go @@ -20,6 +20,7 @@ import ( "log" "cloud.google.com/go/bigquery" + "github.com/ossf/scorecard/cron/config" ) diff --git a/cron/config/config.go b/cron/config/config.go index 6fd8a1d5..d958a830 100644 --- a/cron/config/config.go +++ b/cron/config/config.go @@ -15,7 +15,9 @@ package config import ( - _ "embed" // Used to embed config.yaml + + // Used to embed config.yaml. + _ "embed" "errors" "fmt" "os" diff --git a/cron/controller/main.go b/cron/controller/main.go index 63ff1f74..fd51212a 100644 --- a/cron/controller/main.go +++ b/cron/controller/main.go @@ -20,10 +20,11 @@ import ( "strconv" "time" + "google.golang.org/protobuf/types/known/timestamppb" + "github.com/ossf/scorecard/cron/config" "github.com/ossf/scorecard/cron/data" "github.com/ossf/scorecard/cron/pubsub" - "google.golang.org/protobuf/types/known/timestamppb" ) func PublishToRepoRequestTopic(ctx context.Context, iter data.Iterator, datetime time.Time) (int32, error) { diff --git a/cron/data/blob.go b/cron/data/blob.go index c0d82eb6..da877752 100644 --- a/cron/data/blob.go +++ b/cron/data/blob.go @@ -19,9 +19,12 @@ import ( "fmt" "time" - "github.com/ossf/scorecard/cron/config" "gocloud.dev/blob" - _ "gocloud.dev/blob/gcsblob" // Needed to link in GCP drivers. + + // Needed to link in GCP drivers. + _ "gocloud.dev/blob/gcsblob" + + "github.com/ossf/scorecard/cron/config" ) const ( diff --git a/cron/data/iterator.go b/cron/data/iterator.go index 53a2751d..87d1edfb 100644 --- a/cron/data/iterator.go +++ b/cron/data/iterator.go @@ -22,6 +22,7 @@ import ( "io" "github.com/jszwec/csvutil" + "github.com/ossf/scorecard/repos" ) diff --git a/cron/main.go b/cron/main.go index 8bf709de..5f5220f0 100644 --- a/cron/main.go +++ b/cron/main.go @@ -28,6 +28,10 @@ import ( "contrib.go.opencensus.io/exporter/stackdriver" "github.com/google/go-github/v32/github" "github.com/jszwec/csvutil" + "github.com/shurcooL/githubv4" + "go.opencensus.io/stats/view" + "go.uber.org/zap" + "github.com/ossf/scorecard/checks" "github.com/ossf/scorecard/cron/bq" "github.com/ossf/scorecard/cron/monitoring" @@ -35,9 +39,6 @@ import ( "github.com/ossf/scorecard/repos" "github.com/ossf/scorecard/roundtripper" "github.com/ossf/scorecard/stats" - "github.com/shurcooL/githubv4" - "go.opencensus.io/stats/view" - "go.uber.org/zap" ) type Repository struct { diff --git a/cron/monitoring/exporter.go b/cron/monitoring/exporter.go index 687b22e4..90b75a13 100644 --- a/cron/monitoring/exporter.go +++ b/cron/monitoring/exporter.go @@ -18,6 +18,7 @@ import ( "fmt" "contrib.go.opencensus.io/exporter/stackdriver" + "github.com/ossf/scorecard/cron/config" ) diff --git a/cron/pubsub/publisher.go b/cron/pubsub/publisher.go index 4ffb0c7d..e0648f7f 100644 --- a/cron/pubsub/publisher.go +++ b/cron/pubsub/publisher.go @@ -22,10 +22,13 @@ import ( "sync" "sync/atomic" - "github.com/ossf/scorecard/cron/data" "gocloud.dev/pubsub" - _ "gocloud.dev/pubsub/gcppubsub" // Needed to link in GCP drivers. + + // Needed to link in GCP drivers. + _ "gocloud.dev/pubsub/gcppubsub" "google.golang.org/protobuf/encoding/protojson" + + "github.com/ossf/scorecard/cron/data" ) var errorPublish = errors.New("total errors when publishing") diff --git a/cron/pubsub/publisher_test.go b/cron/pubsub/publisher_test.go index 5777de42..f3db626f 100644 --- a/cron/pubsub/publisher_test.go +++ b/cron/pubsub/publisher_test.go @@ -19,8 +19,9 @@ import ( "fmt" "testing" - "github.com/ossf/scorecard/cron/data" "gocloud.dev/pubsub" + + "github.com/ossf/scorecard/cron/data" ) type mockSucceedTopic struct{} diff --git a/cron/pubsub/subscriber.go b/cron/pubsub/subscriber.go index af3d703f..171389ad 100644 --- a/cron/pubsub/subscriber.go +++ b/cron/pubsub/subscriber.go @@ -19,10 +19,13 @@ import ( "errors" "fmt" - "github.com/ossf/scorecard/cron/data" "gocloud.dev/pubsub" - _ "gocloud.dev/pubsub/gcppubsub" // Needed to link in GCP drivers. + + // Needed to link in GCP drivers. + _ "gocloud.dev/pubsub/gcppubsub" "google.golang.org/protobuf/encoding/protojson" + + "github.com/ossf/scorecard/cron/data" ) var ErrorInParse = errors.New("error during protojson.Unmarshal") diff --git a/cron/pubsub/subscriber_test.go b/cron/pubsub/subscriber_test.go index 2ef3fa3b..be9efe4d 100644 --- a/cron/pubsub/subscriber_test.go +++ b/cron/pubsub/subscriber_test.go @@ -19,10 +19,11 @@ import ( "errors" "testing" - "github.com/ossf/scorecard/cron/data" "gocloud.dev/pubsub" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" + + "github.com/ossf/scorecard/cron/data" ) type mockReceiver struct { diff --git a/cron/worker/main.go b/cron/worker/main.go index 5428b35f..631b50ec 100644 --- a/cron/worker/main.go +++ b/cron/worker/main.go @@ -24,6 +24,9 @@ import ( "sync" "github.com/google/go-github/v32/github" + "github.com/shurcooL/githubv4" + "go.uber.org/zap" + "github.com/ossf/scorecard/checks" "github.com/ossf/scorecard/cron/config" "github.com/ossf/scorecard/cron/data" @@ -31,8 +34,6 @@ import ( "github.com/ossf/scorecard/pkg" "github.com/ossf/scorecard/repos" "github.com/ossf/scorecard/roundtripper" - "github.com/shurcooL/githubv4" - "go.uber.org/zap" ) func processRequest(ctx context.Context, diff --git a/e2e/active_test.go b/e2e/active_test.go index 24b1e6a1..728e7df6 100644 --- a/e2e/active_test.go +++ b/e2e/active_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/blob_test.go b/e2e/blob_test.go index 4581bf80..09c24f5f 100644 --- a/e2e/blob_test.go +++ b/e2e/blob_test.go @@ -20,6 +20,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/roundtripper" ) diff --git a/e2e/branchprotection_test.go b/e2e/branchprotection_test.go index a4fca300..e3de1788 100644 --- a/e2e/branchprotection_test.go +++ b/e2e/branchprotection_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/ci_tests_test.go b/e2e/ci_tests_test.go index 65804ba9..f622915a 100644 --- a/e2e/ci_tests_test.go +++ b/e2e/ci_tests_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/cii_best_practices_test.go b/e2e/cii_best_practices_test.go index 6f72bd6c..4f22e25d 100644 --- a/e2e/cii_best_practices_test.go +++ b/e2e/cii_best_practices_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/code_review_test.go b/e2e/code_review_test.go index 1e00c3f9..1b08358d 100644 --- a/e2e/code_review_test.go +++ b/e2e/code_review_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/contributors_test.go b/e2e/contributors_test.go index aed314f9..47660eae 100644 --- a/e2e/contributors_test.go +++ b/e2e/contributors_test.go @@ -20,6 +20,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/e2e_suite_test.go b/e2e/e2e_suite_test.go index 17fd38e0..c570128a 100644 --- a/e2e/e2e_suite_test.go +++ b/e2e/e2e_suite_test.go @@ -24,9 +24,10 @@ import ( "github.com/google/go-github/v32/github" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/ossf/scorecard/roundtripper" "github.com/shurcooL/githubv4" "go.uber.org/zap" + + "github.com/ossf/scorecard/roundtripper" ) var ( diff --git a/e2e/frozen_deps_test.go b/e2e/frozen_deps_test.go index a138572e..f537f6b3 100644 --- a/e2e/frozen_deps_test.go +++ b/e2e/frozen_deps_test.go @@ -20,6 +20,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/fuzzing_test.go b/e2e/fuzzing_test.go index c9296d6c..e2f5338e 100644 --- a/e2e/fuzzing_test.go +++ b/e2e/fuzzing_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/packaging_test.go b/e2e/packaging_test.go index 1e62f60e..1834c825 100644 --- a/e2e/packaging_test.go +++ b/e2e/packaging_test.go @@ -20,6 +20,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/pull_requests_test.go b/e2e/pull_requests_test.go index f679e167..02e8a4cf 100644 --- a/e2e/pull_requests_test.go +++ b/e2e/pull_requests_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/sast_test.go b/e2e/sast_test.go index 2e57bd5f..ba8c99f9 100644 --- a/e2e/sast_test.go +++ b/e2e/sast_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/security_policy_test.go b/e2e/security_policy_test.go index 1f9a8a54..22af07d1 100644 --- a/e2e/security_policy_test.go +++ b/e2e/security_policy_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/e2e/signedreleases_test.go b/e2e/signedreleases_test.go index 664072a8..84ae5b92 100644 --- a/e2e/signedreleases_test.go +++ b/e2e/signedreleases_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/checks" ) diff --git a/gitcache/e2e/e2e_bucketcache_test.go b/gitcache/e2e/e2e_bucketcache_test.go index 9d2976ac..5eedc9e9 100644 --- a/gitcache/e2e/e2e_bucketcache_test.go +++ b/gitcache/e2e/e2e_bucketcache_test.go @@ -18,6 +18,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/gitcache/pkg" ) diff --git a/gitcache/e2e/e2e_http_test.go b/gitcache/e2e/e2e_http_test.go index bb8db2da..35a0a9e6 100644 --- a/gitcache/e2e/e2e_http_test.go +++ b/gitcache/e2e/e2e_http_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/ossf/scorecard/gitcache/pkg" ) diff --git a/gitcache/main.go b/gitcache/main.go index ecf64e4c..8fb8f5c7 100644 --- a/gitcache/main.go +++ b/gitcache/main.go @@ -21,8 +21,9 @@ import ( "net/http" "os" - "github.com/ossf/scorecard/gitcache/pkg" "go.uber.org/zap" + + "github.com/ossf/scorecard/gitcache/pkg" ) type cache struct { diff --git a/pkg/scorecard.go b/pkg/scorecard.go index 1fa0f79e..6fba2967 100644 --- a/pkg/scorecard.go +++ b/pkg/scorecard.go @@ -21,9 +21,10 @@ import ( "time" "github.com/google/go-github/v32/github" + "github.com/shurcooL/githubv4" + "github.com/ossf/scorecard/checker" "github.com/ossf/scorecard/repos" - "github.com/shurcooL/githubv4" ) func runEnabledChecks(ctx context.Context, diff --git a/roundtripper/census.go b/roundtripper/census.go index 56eed56c..fbaf8be9 100644 --- a/roundtripper/census.go +++ b/roundtripper/census.go @@ -18,10 +18,11 @@ import ( "fmt" "net/http" - "github.com/ossf/scorecard/stats" "go.opencensus.io/plugin/ochttp" opencensusstats "go.opencensus.io/stats" "go.opencensus.io/tag" + + "github.com/ossf/scorecard/stats" ) func MakeCensusTransport(innerTransport http.RoundTripper) http.RoundTripper { diff --git a/roundtripper/rate_limit.go b/roundtripper/rate_limit.go index ca5a4a80..8b24cbc7 100644 --- a/roundtripper/rate_limit.go +++ b/roundtripper/rate_limit.go @@ -20,11 +20,12 @@ import ( "strconv" "time" - "github.com/ossf/scorecard/stats" "github.com/pkg/errors" opencensusstats "go.opencensus.io/stats" "go.opencensus.io/tag" "go.uber.org/zap" + + "github.com/ossf/scorecard/stats" ) func MakeRateLimitedTransport(innerTransport http.RoundTripper, logger *zap.SugaredLogger) http.RoundTripper {