diff --git a/.github/workflows/lint-action/action.yml b/.github/workflows/lint-action/action.yml index 245842e5a9c..0eb6f39d84e 100644 --- a/.github/workflows/lint-action/action.yml +++ b/.github/workflows/lint-action/action.yml @@ -22,6 +22,6 @@ runs: uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.54.2 + version: v1.55.2 # https://github.com/golangci/golangci-lint-action/issues/135 skip-pkg-cache: true diff --git a/cmd/osv-scanner/main_test.go b/cmd/osv-scanner/main_test.go index d105487e346..05469c15dcf 100644 --- a/cmd/osv-scanner/main_test.go +++ b/cmd/osv-scanner/main_test.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" "regexp" + "strconv" "strings" "testing" @@ -59,7 +60,7 @@ func dedent(t *testing.T, str string) string { } } - re := regexp.MustCompile(`\n[\t ]{` + fmt.Sprint(size) + `}`) + re := regexp.MustCompile(`\n[\t ]{` + strconv.Itoa(size) + `}`) str = re.ReplaceAllString(str, "\n") } diff --git a/internal/sbom/sbom.go b/internal/sbom/sbom.go index a35a3d65cc4..f6b5b810861 100644 --- a/internal/sbom/sbom.go +++ b/internal/sbom/sbom.go @@ -11,16 +11,16 @@ type Identifier struct { PURL string } -// SBOMReader is an interface for all SBOM providers. -type SBOMReader interface { +// Reader is an interface for all SBOM providers. +type Reader interface { Name() string - // Checks if the file path is a standard recognized file name - MatchesRecognizedFileNames(string) bool - GetPackages(io.ReadSeeker, func(Identifier) error) error + // MatchesRecognizedFileNames checks if the file path is a standard recognized file name + MatchesRecognizedFileNames(path string) bool + GetPackages(r io.ReadSeeker, callback func(Identifier) error) error } var ( - Providers = []SBOMReader{ + Providers = []Reader{ &SPDX{}, &CycloneDX{}, } diff --git a/pkg/depsdev/license.go b/pkg/depsdev/license.go index 3a99ac4c5d5..8ec5e849ca9 100644 --- a/pkg/depsdev/license.go +++ b/pkg/depsdev/license.go @@ -81,8 +81,8 @@ func MakeVersionRequests(queries []*depsdevpb.GetVersionRequest) ([][]models.Lic return err } - ls := make([]models.License, len(resp.Licenses)) - for j, license := range resp.Licenses { + ls := make([]models.License, len(resp.GetLicenses())) + for j, license := range resp.GetLicenses() { ls[j] = models.License(license) } if len(ls) == 0 { diff --git a/pkg/lockfile/extractor.go b/pkg/lockfile/extractor.go index f3349e41e0c..7e057651755 100644 --- a/pkg/lockfile/extractor.go +++ b/pkg/lockfile/extractor.go @@ -18,7 +18,7 @@ type DepFile interface { // current DepFile if the provided path is relative. // // If the path is an absolute path, then it is opened absolutely. - Open(string) (NestedDepFile, error) + Open(path string) (NestedDepFile, error) Path() string } diff --git a/scripts/run_lints.sh b/scripts/run_lints.sh index 0bc3e767ff3..f23aa2a83af 100755 --- a/scripts/run_lints.sh +++ b/scripts/run_lints.sh @@ -2,4 +2,4 @@ set -ex -go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2 run ./... --max-same-issues 0 +go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 run ./... --max-same-issues 0