diff --git a/.github/workflows/lint-action/action.yml b/.github/workflows/lint-action/action.yml index a0322aee571..245842e5a9c 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.51.1 + version: v1.54.2 # https://github.com/golangci/golangci-lint-action/issues/135 - skip-pkg-cache: true \ No newline at end of file + skip-pkg-cache: true diff --git a/pkg/models/vulnerability.go b/pkg/models/vulnerability.go index db7a0e171ac..1f87b5f3641 100644 --- a/pkg/models/vulnerability.go +++ b/pkg/models/vulnerability.go @@ -10,8 +10,8 @@ import ( // // See: https://ossf.github.io/osv-schema/#affectedpackage-field type Package struct { - Ecosystem Ecosystem `json:"ecosystem" yaml:"ecosystem"` - Name string `json:"name" yaml:"name"` + Ecosystem Ecosystem `json:"ecosystem" yaml:"ecosystem"` + Name string `json:"name" yaml:"name"` Purl string `json:"purl,omitempty" yaml:"purl,omitempty"` } @@ -27,19 +27,19 @@ type Package struct { // // See: https://ossf.github.io/osv-schema/#affectedrangesevents-fields type Event struct { - Introduced string `json:"introduced,omitempty" yaml:"introduced,omitempty"` - Fixed string `json:"fixed,omitempty" yaml:"fixed,omitempty"` + Introduced string `json:"introduced,omitempty" yaml:"introduced,omitempty"` + Fixed string `json:"fixed,omitempty" yaml:"fixed,omitempty"` LastAffected string `json:"last_affected,omitempty" yaml:"last_affected,omitempty"` - Limit string `json:"limit,omitempty" yaml:"limit,omitempty"` + Limit string `json:"limit,omitempty" yaml:"limit,omitempty"` } // Range describes the affected range of given version for a specific package. // // See: https://ossf.github.io/osv-schema/#affectedranges-field type Range struct { - Type RangeType `json:"type" yaml:"type"` - Events []Event `json:"events" yaml:"events"` - Repo string `json:"repo,omitempty" yaml:"repo,omitempty"` + Type RangeType `json:"type" yaml:"type"` + Events []Event `json:"events" yaml:"events"` + Repo string `json:"repo,omitempty" yaml:"repo,omitempty"` DatabaseSpecific map[string]interface{} `json:"database_specific,omitempty" yaml:"database_specific,omitempty"` } @@ -48,7 +48,7 @@ type Range struct { // // See: https://ossf.github.io/osv-schema/#severity-field type Severity struct { - Type SeverityType `json:"type" yaml:"type"` + Type SeverityType `json:"type" yaml:"type"` Score string `json:"score" yaml:"score"` } @@ -57,11 +57,11 @@ type Severity struct { // // See: https://ossf.github.io/osv-schema/#affected-fields type Affected struct { - Package Package `json:"package,omitempty" yaml:"package,omitempty"` - Severity []Severity `json:"severity,omitempty" yaml:"severity,omitempty"` - Ranges []Range `json:"ranges,omitempty" yaml:"ranges,omitempty"` - Versions []string `json:"versions,omitempty" yaml:"versions,omitempty"` - DatabaseSpecific map[string]interface{} `json:"database_specific,omitempty" yaml:"database_specific,omitempty"` + Package Package `json:"package,omitempty" yaml:"package,omitempty"` + Severity []Severity `json:"severity,omitempty" yaml:"severity,omitempty"` + Ranges []Range `json:"ranges,omitempty" yaml:"ranges,omitempty"` + Versions []string `json:"versions,omitempty" yaml:"versions,omitempty"` + DatabaseSpecific map[string]interface{} `json:"database_specific,omitempty" yaml:"database_specific,omitempty"` EcosystemSpecific map[string]interface{} `json:"ecosystem_specific,omitempty" yaml:"ecosystem_specific,omitempty"` } @@ -92,7 +92,7 @@ func (a Affected) MarshalJSON() ([]byte, error) { // See: https://ossf.github.io/osv-schema/#references-field type Reference struct { Type ReferenceType `json:"type" yaml:"type"` - URL string `json:"url" yaml:"url"` + URL string `json:"url" yaml:"url"` } // Credit gives credit for the discovery, confirmation, patch, or other events @@ -100,8 +100,8 @@ type Reference struct { // // See: https://ossf.github.io/osv-schema/#credits-fields type Credit struct { - Name string `json:"name" yaml:"name"` - Type CreditType `json:"type,omitempty" yaml:"type,omitempty"` + Name string `json:"name" yaml:"name"` + Type CreditType `json:"type,omitempty" yaml:"type,omitempty"` Contact []string `json:"contact,omitempty" yaml:"contact,omitempty"` } @@ -110,19 +110,19 @@ type Credit struct { // The full documentation for the schema is available at // https://ossf.github.io/osv-schema. type Vulnerability struct { - SchemaVersion string `json:"schema_version,omitempty" yaml:"schema_version,omitempty"` - ID string `json:"id" yaml:"id"` - Modified time.Time `json:"modified" yaml:"modified"` - Published time.Time `json:"published,omitempty" yaml:"published,omitempty"` - Withdrawn time.Time `json:"withdrawn,omitempty" yaml:"withdrawn,omitempty"` - Aliases []string `json:"aliases,omitempty" yaml:"aliases,omitempty"` - Related []string `json:"related,omitempty" yaml:"related,omitempty"` - Summary string `json:"summary,omitempty" yaml:"summary,omitempty"` - Details string `json:"details,omitempty" yaml:"details,omitempty"` - Affected []Affected `json:"affected,omitempty" yaml:"affected,omitempty"` - Severity []Severity `json:"severity,omitempty" yaml:"severity,omitempty"` - References []Reference `json:"references,omitempty" yaml:"references,omitempty"` - Credits []Credit `json:"credits,omitempty" yaml:"credits,omitempty"` + SchemaVersion string `json:"schema_version,omitempty" yaml:"schema_version,omitempty"` + ID string `json:"id" yaml:"id"` + Modified time.Time `json:"modified" yaml:"modified"` + Published time.Time `json:"published,omitempty" yaml:"published,omitempty"` + Withdrawn time.Time `json:"withdrawn,omitempty" yaml:"withdrawn,omitempty"` + Aliases []string `json:"aliases,omitempty" yaml:"aliases,omitempty"` + Related []string `json:"related,omitempty" yaml:"related,omitempty"` + Summary string `json:"summary,omitempty" yaml:"summary,omitempty"` + Details string `json:"details,omitempty" yaml:"details,omitempty"` + Affected []Affected `json:"affected,omitempty" yaml:"affected,omitempty"` + Severity []Severity `json:"severity,omitempty" yaml:"severity,omitempty"` + References []Reference `json:"references,omitempty" yaml:"references,omitempty"` + Credits []Credit `json:"credits,omitempty" yaml:"credits,omitempty"` DatabaseSpecific map[string]interface{} `json:"database_specific,omitempty" yaml:"database_specific,omitempty"` } diff --git a/scripts/run_lints.sh b/scripts/run_lints.sh index 42ee56734c0..0bc3e767ff3 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.51.1 run ./... --max-same-issues 0 +go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2 run ./... --max-same-issues 0