Skip to content

Commit 348b48c

Browse files
authored
fix: License scanning to match new deps.dev names (#2395)
They are also looking at implementing a translation layer to keep supporting the old version format (eta sometime next week) to make sure existing osv-scanner queries are not broken. Closes #2394
1 parent c997781 commit 348b48c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

internal/clients/clientimpl/licensematcher/licensematcher.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,14 @@ func (matcher *DepsDevLicenseMatcher) makeVersionRequest(ctx context.Context, qu
9696
}
9797

9898
func versionQuery(system depsdevpb.System, name string, version string) *depsdevpb.GetVersionRequest {
99-
if system == depsdevpb.System_GO && name != "stdlib" {
100-
version = "v" + version
99+
if system == depsdevpb.System_GO {
100+
// deps.dev uses native go versioning, which includes prepending v for package versions
101+
// and go for stdlib
102+
if name == "stdlib" {
103+
version = "go" + version
104+
} else {
105+
version = "v" + version
106+
}
101107
}
102108

103109
return &depsdevpb.GetVersionRequest{

0 commit comments

Comments
 (0)