| ##### |
| # 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 |