Update go version
This commit is contained in:
1
vendor/golang.org/x/vuln/internal/buildinfo/additions_buildinfo.go
generated
vendored
1
vendor/golang.org/x/vuln/internal/buildinfo/additions_buildinfo.go
generated
vendored
@@ -3,7 +3,6 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build go1.18
|
||||
// +build go1.18
|
||||
|
||||
package buildinfo
|
||||
|
||||
|
||||
1
vendor/golang.org/x/vuln/internal/buildinfo/additions_scan.go
generated
vendored
1
vendor/golang.org/x/vuln/internal/buildinfo/additions_scan.go
generated
vendored
@@ -3,7 +3,6 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build go1.18
|
||||
// +build go1.18
|
||||
|
||||
package buildinfo
|
||||
|
||||
|
||||
1
vendor/golang.org/x/vuln/internal/buildinfo/buildinfo.go
generated
vendored
1
vendor/golang.org/x/vuln/internal/buildinfo/buildinfo.go
generated
vendored
@@ -3,7 +3,6 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build go1.18
|
||||
// +build go1.18
|
||||
|
||||
package buildinfo
|
||||
|
||||
|
||||
14
vendor/golang.org/x/vuln/internal/scan/errors.go
generated
vendored
14
vendor/golang.org/x/vuln/internal/scan/errors.go
generated
vendored
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
//lint:file-ignore ST1005 Ignore staticcheck message about error formatting
|
||||
var (
|
||||
// ErrVulnerabilitiesFound indicates that vulnerabilities were detected
|
||||
// errVulnerabilitiesFound indicates that vulnerabilities were detected
|
||||
// when running govulncheck. This returns exit status 3 when running
|
||||
// without the -json flag.
|
||||
errVulnerabilitiesFound = &exitCodeError{message: "vulnerabilities found", code: 3}
|
||||
@@ -25,6 +25,18 @@ var (
|
||||
// govulncheck and exit with status 2.
|
||||
errUsage = &exitCodeError{message: "invalid usage", code: 2}
|
||||
|
||||
// errNoPatterns indicates that no package patterns were provided if the scan level is WantPackages.
|
||||
errNoPatterns = &exitCodeError{
|
||||
message: "no package patterns provided\n\nTo scan the current module, run: govulncheck ./...",
|
||||
code: 2,
|
||||
}
|
||||
|
||||
// errNoPackagesMatched indicates that the provided patterns matched no packages if scan level is WantPackages.
|
||||
errNoPackagesMatched = &exitCodeError{
|
||||
message: "no packages matched the provided patterns",
|
||||
code: 2,
|
||||
}
|
||||
|
||||
// errGoVersionMismatch is used to indicate that there is a mismatch between
|
||||
// the Go version used to build govulncheck and the one currently on PATH.
|
||||
errGoVersionMismatch = errors.New(`Loading packages failed, possibly due to a mismatch between the Go version
|
||||
|
||||
2
vendor/golang.org/x/vuln/internal/scan/flags.go
generated
vendored
2
vendor/golang.org/x/vuln/internal/scan/flags.go
generated
vendored
@@ -25,6 +25,7 @@ type config struct {
|
||||
test bool
|
||||
show ShowFlag
|
||||
format FormatFlag
|
||||
version bool
|
||||
env []string
|
||||
}
|
||||
|
||||
@@ -72,6 +73,7 @@ Usage:
|
||||
cfg.patterns = flags.Args()
|
||||
if version {
|
||||
cfg.show = append(cfg.show, "version")
|
||||
cfg.version = true
|
||||
}
|
||||
cfg.ScanLevel = govulncheck.ScanLevel(scanFlag)
|
||||
cfg.ScanMode = govulncheck.ScanMode(modeFlag)
|
||||
|
||||
13
vendor/golang.org/x/vuln/internal/scan/run.go
generated
vendored
13
vendor/golang.org/x/vuln/internal/scan/run.go
generated
vendored
@@ -22,9 +22,8 @@ import (
|
||||
"golang.org/x/vuln/internal/sarif"
|
||||
)
|
||||
|
||||
// RunGovulncheck performs main govulncheck functionality and exits the
|
||||
// program upon success with an appropriate exit status. Otherwise,
|
||||
// returns an error.
|
||||
// RunGovulncheck performs main govulncheck functionality.
|
||||
// On failure, the returned error wraps an exit code error (see scan.Cmd.Wait).
|
||||
func RunGovulncheck(ctx context.Context, env []string, r io.Reader, stdout io.Writer, stderr io.Writer, args []string) error {
|
||||
cfg := &config{env: env}
|
||||
if err := parseFlags(cfg, stderr, args); err != nil {
|
||||
@@ -55,6 +54,12 @@ func RunGovulncheck(ctx context.Context, env []string, r io.Reader, stdout io.Wr
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.version {
|
||||
// If the -version flag is passed, exit before doing anything else. This is different than
|
||||
// passing -show which includes "version".
|
||||
return nil
|
||||
}
|
||||
|
||||
incTelemetryFlagCounters(cfg)
|
||||
|
||||
switch cfg.ScanMode {
|
||||
@@ -104,7 +109,7 @@ func prepareConfig(ctx context.Context, cfg *config, client *client.Client) {
|
||||
// this binary used from the build info.
|
||||
func scannerVersion(cfg *config, bi *debug.BuildInfo) {
|
||||
if bi.Path != "" {
|
||||
cfg.ScannerName = path.Base(bi.Path)
|
||||
cfg.ScannerName = strings.TrimSuffix(path.Base(bi.Path), ".test")
|
||||
}
|
||||
if bi.Main.Version != "" && bi.Main.Version != "(devel)" {
|
||||
cfg.ScannerVersion = bi.Main.Version
|
||||
|
||||
4
vendor/golang.org/x/vuln/internal/scan/source.go
generated
vendored
4
vendor/golang.org/x/vuln/internal/scan/source.go
generated
vendored
@@ -24,7 +24,7 @@ func runSource(ctx context.Context, handler govulncheck.Handler, cfg *config, cl
|
||||
defer derrors.Wrap(&err, "govulncheck")
|
||||
|
||||
if cfg.ScanLevel.WantPackages() && len(cfg.patterns) == 0 {
|
||||
return nil // don't throw an error here
|
||||
return errNoPatterns
|
||||
}
|
||||
if !gomodExists(dir) {
|
||||
return errNoGoMod
|
||||
@@ -43,7 +43,7 @@ func runSource(ctx context.Context, handler govulncheck.Handler, cfg *config, cl
|
||||
}
|
||||
|
||||
if cfg.ScanLevel.WantPackages() && len(graph.TopPkgs()) == 0 {
|
||||
return nil // early exit
|
||||
return errNoPackagesMatched
|
||||
}
|
||||
return vulncheck.Source(ctx, handler, &cfg.Config, client, graph)
|
||||
}
|
||||
|
||||
2
vendor/golang.org/x/vuln/internal/vulncheck/utils.go
generated
vendored
2
vendor/golang.org/x/vuln/internal/vulncheck/utils.go
generated
vendored
@@ -93,7 +93,7 @@ func callGraph(ctx context.Context, prog *ssa.Program, entries []*ssa.Function)
|
||||
// - pointer designation * is skipped
|
||||
// - full path prefix is skipped as well
|
||||
func dbTypeFormat(t types.Type) string {
|
||||
switch tt := t.(type) {
|
||||
switch tt := types.Unalias(t).(type) {
|
||||
case *types.Pointer:
|
||||
return dbTypeFormat(tt.Elem())
|
||||
case *types.Named:
|
||||
|
||||
Reference in New Issue
Block a user