File: source_fail.ct

package info (click to toggle)
golang-golang-x-vuln 1.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,400 kB
  • sloc: sh: 161; asm: 40; makefile: 7
file content (35 lines) | stat: -rw-r--r-- 1,127 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#####
# Test of missing go.mod error message.
$ govulncheck -C ${moddir}/{nomoddir} . --> FAIL 1
govulncheck: no go.mod file

govulncheck only works with Go modules. Try navigating to your module directory.
Otherwise, run go mod init to make your project a module.

See https://go.dev/doc/modules/managing-dependencies for more information.

#####
# Test of handing a binary to source mode
$ govulncheck ${vuln_binary} --> FAIL 2
govulncheck: myfile is a file.

By default, govulncheck runs source analysis on Go modules.

Did you mean to run govulncheck with -mode=binary?

For details, run govulncheck -h.

#####
# Test of handing an invalid package pattern to source mode
$ govulncheck -C ${moddir}/vuln blah --> FAIL 1
govulncheck: loading packages: 
There are errors with the provided package patterns:

-: package foo is not in GOROOT (/tmp/foo)

For details on package patterns, see https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns.

#####
# Test of handing a package pattern to scan level module
$ govulncheck -scan module -C ${moddir}/vuln pattern --> FAIL 2
patterns are not accepted for module only scanning