Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix false positive golangci-linter typecheck error #589

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix linter false positive
  • Loading branch information
eranturgeman committed Nov 28, 2023
commit 2464c0dfb35cd05e8da7d8e3a4c1ccbb93f94d8d
2 changes: 1 addition & 1 deletion scanrepository/scanrepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ func parseVersionChangeString(fixVersion string) string {
// Skip build tools dependencies (for example, pip)
// that are not defined in the descriptor file and cannot be fixed by a PR.
func isBuildToolsDependency(vulnDetails *utils.VulnerabilityDetails) error {
//nolint:typecheck // Ignoring typecheck error: linter cannot infer the type returned by utils.BuildToolsDependenciesMap as []string although utils.BuildToolsDependenciesMap is declared as map[coreutils.Technology][]string in utils/utils.go
//nolint:typecheck // Ignoring typecheck error: The linter fails to deduce the returned type as []string from utils.BuildToolsDependenciesMap, despite its declaration in utils/utils.go as map[coreutils.Technology][]string.
if slices.Contains(utils.BuildToolsDependenciesMap[vulnDetails.Technology], vulnDetails.ImpactedDependencyName) {
return &utils.ErrUnsupportedFix{
PackageName: vulnDetails.ImpactedDependencyName,
Expand Down
Loading