Skip to content

Commit a48c6a2

Browse files
committed
cmd/govulncheck: add test exhibiting multiple reported symbols per OSV
This makes it clear that we show a call stack per detected symbol in default mode. Change-Id: I81ae1f9494524752b6492cc20a328e0075f9fbae Reviewed-on: https://go-review.googlesource.com/c/vuln/+/443515 Run-TryBot: Zvonimir Pavlinovic <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]>
1 parent 4d1ee16 commit a48c6a2

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cmd/govulncheck/testdata/default.ct

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ govulncheck is an experimental tool. Share feedback at https://go.dev/s/govulnch
77
Scanning for dependencies with known vulnerabilities...
88
No vulnerabilities found.
99

10-
$ govulncheck -dir ${moddir}/vuln . --> FAIL 3
10+
$ govulncheck -tags=twocallstacks -dir ${moddir}/vuln . --> FAIL 3
1111
govulncheck is an experimental tool. Share feedback at https://go.dev/s/govulncheck-feedback.
1212

1313
Scanning for dependencies with known vulnerabilities...
@@ -21,6 +21,7 @@ Vulnerability #1: GO-2021-0113
2121

2222
Call stacks in your code:
2323
.../vuln.go:12:16: golang.org/vuln.main calls golang.org/x/text/language.Parse
24+
.../vuln_extra.go:8:30: golang.org/vuln.init#1 calls golang.org/x/text/language.ParseAcceptLanguage
2425

2526
Found in: golang.org/x/text/[email protected]
2627
Fixed in: golang.org/x/text/[email protected]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//go:build twocallstacks
2+
3+
package main
4+
5+
import "golang.org/x/text/language"
6+
7+
func init() {
8+
language.ParseAcceptLanguage("")
9+
}

0 commit comments

Comments
 (0)