vulndb icon indicating copy to clipboard operation
vulndb copied to clipboard

fix json tests

Open knqyf263 opened this issue 3 years ago • 1 comments

Before:

$ go test ./...
# golang.org/x/vulndb/osv [golang.org/x/vulndb/osv.test]
osv/json_test.go:18:3: cannot use []struct { Module string; Package string; Symbols []string; Versions []report.VersionRange }{...} (type []struct { Module string; Package string; Symbols []string; Versions []report.VersionRange }) as type []struct { Module string "yaml:\",omitempty\""; Package string "yaml:\",omitempty\""; Symbols []string "yaml:\",omitempty\""; Versions []report.VersionRange "yaml:\",omitempty\"" } in field value
osv/json_test.go:46:3: cannot use struct { PR string; Commit string; Context []string }{...} (type struct { PR string; Commit string; Context []string }) as type struct { PR string "yaml:\",omitempty\""; Commit string "yaml:\",omitempty\""; Context []string "yaml:\",omitempty\"" } in field value
ok      golang.org/x/vulndb/client      (cached)
?       golang.org/x/vulndb/cmd/gendb   [no test files]
?       golang.org/x/vulndb/cmd/genhtml [no test files]
?       golang.org/x/vulndb/cmd/linter  [no test files]
?       golang.org/x/vulndb/cmd/report2cve      [no test files]
FAIL    golang.org/x/vulndb/osv [build failed]
?       golang.org/x/vulndb/report      [no test files]
FAIL

After:

$ go test ./...
ok      golang.org/x/vulndb/client
?       golang.org/x/vulndb/cmd/gendb   [no test files]
?       golang.org/x/vulndb/cmd/genhtml [no test files]
?       golang.org/x/vulndb/cmd/linter  [no test files]
?       golang.org/x/vulndb/cmd/report2cve      [no test files]
ok      golang.org/x/vulndb/osv 0.243s
?       golang.org/x/vulndb/report      [no test files]

knqyf263 avatar Apr 28 '21 16:04 knqyf263