mirror of
https://github.com/containers/skopeo.git
synced 2025-09-23 02:48:26 +00:00
bump golang.org/x/net to v0.8.0
Resolves: CVE-2022-41723 Ref: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2022-41723 Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
16
vendor/golang.org/x/tools/internal/gocommand/version.go
generated
vendored
16
vendor/golang.org/x/tools/internal/gocommand/version.go
generated
vendored
@@ -58,22 +58,24 @@ func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) {
|
||||
return 0, fmt.Errorf("no parseable ReleaseTags in %v", tags)
|
||||
}
|
||||
|
||||
// GoVersionString reports the go version string as shown in `go version` command output.
|
||||
// When `go version` outputs in non-standard form, this returns an empty string.
|
||||
func GoVersionString(ctx context.Context, inv Invocation, r *Runner) (string, error) {
|
||||
// GoVersionOutput returns the complete output of the go version command.
|
||||
func GoVersionOutput(ctx context.Context, inv Invocation, r *Runner) (string, error) {
|
||||
inv.Verb = "version"
|
||||
goVersion, err := r.Run(ctx, inv)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return parseGoVersionOutput(goVersion.Bytes()), nil
|
||||
return goVersion.String(), nil
|
||||
}
|
||||
|
||||
func parseGoVersionOutput(data []byte) string {
|
||||
// ParseGoVersionOutput extracts the Go version string
|
||||
// from the output of the "go version" command.
|
||||
// Given an unrecognized form, it returns an empty string.
|
||||
func ParseGoVersionOutput(data string) string {
|
||||
re := regexp.MustCompile(`^go version (go\S+|devel \S+)`)
|
||||
m := re.FindSubmatch(data)
|
||||
m := re.FindStringSubmatch(data)
|
||||
if len(m) != 2 {
|
||||
return "" // unrecognized version
|
||||
}
|
||||
return string(m[1])
|
||||
return m[1]
|
||||
}
|
||||
|
Reference in New Issue
Block a user