From 17b5624da5c274e29ed1a9d3a44f48bad45f14f3 Mon Sep 17 00:00:00 2001 From: svc-excavator-bot Date: Mon, 17 Feb 2025 00:36:25 +0000 Subject: [PATCH] Excavator: Manage go module dependencies --- go.mod | 2 +- go.sum | 4 +-- vendor/github.com/spf13/cobra/command.go | 8 ++--- .../github.com/spf13/cobra/command_go120.go | 33 ------------------- .../github.com/spf13/cobra/command_go121.go | 25 -------------- vendor/github.com/spf13/cobra/completions.go | 2 +- vendor/modules.txt | 2 +- 7 files changed, 8 insertions(+), 68 deletions(-) delete mode 100644 vendor/github.com/spf13/cobra/command_go120.go delete mode 100644 vendor/github.com/spf13/cobra/command_go121.go diff --git a/go.mod b/go.mod index d26b438e..1882a52a 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 github.com/rs/zerolog v1.33.0 github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7 - github.com/spf13/cobra v1.9.0 + github.com/spf13/cobra v1.9.1 github.com/stretchr/testify v1.10.0 github.com/vektah/gqlparser v1.3.1 goji.io v2.0.2+incompatible diff --git a/go.sum b/go.sum index 1a35f5fe..36185d11 100644 --- a/go.sum +++ b/go.sum @@ -101,8 +101,8 @@ github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7/go.mod h1:zqMwyH github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f h1:tygelZueB1EtXkPI6mQ4o9DQ0+FKW41hTbunoXZCTqk= github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/spf13/cobra v1.9.0 h1:Py5fIuq/lJsRYxcxfOtsJqpmwJWCMOUy2tMJYV8TNHE= -github.com/spf13/cobra v1.9.0/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go index fbefc053..dbb2c298 100644 --- a/vendor/github.com/spf13/cobra/command.go +++ b/vendor/github.com/spf13/cobra/command.go @@ -23,6 +23,7 @@ import ( "fmt" "io" "os" + "path/filepath" "sort" "strings" @@ -1100,11 +1101,8 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { args := c.args - // If running unit tests, we don't want to take the os.Args, see #155 and #2173. - // For example, the following would fail: - // go test -c -o foo.test - // ./foo.test -test.run TestNoArgs - if c.args == nil && !isTesting() { + // Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155 + if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" { args = os.Args[1:] } diff --git a/vendor/github.com/spf13/cobra/command_go120.go b/vendor/github.com/spf13/cobra/command_go120.go deleted file mode 100644 index 23bc0feb..00000000 --- a/vendor/github.com/spf13/cobra/command_go120.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2013-2024 The Cobra Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !go1.21 -// +build !go1.21 - -package cobra - -import ( - "os" - "strings" -) - -// based on golang.org/x/mod/internal/lazyregexp: https://cs.opensource.google/go/x/mod/+/refs/tags/v0.19.0:internal/lazyregexp/lazyre.go;l=66 -// For a non-go-test program which still has a name ending with ".test[.exe]", it will need to either: -// 1- Use go >= 1.21, or -// 2- call "rootCmd.SetArgs(os.Args[1:])" before calling "rootCmd.Execute()" -var inTest = len(os.Args) > 0 && strings.HasSuffix(strings.TrimSuffix(os.Args[0], ".exe"), ".test") - -func isTesting() bool { - return inTest -} diff --git a/vendor/github.com/spf13/cobra/command_go121.go b/vendor/github.com/spf13/cobra/command_go121.go deleted file mode 100644 index 8b69f152..00000000 --- a/vendor/github.com/spf13/cobra/command_go121.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2013-2024 The Cobra Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build go1.21 -// +build go1.21 - -package cobra - -import "testing" - -func isTesting() bool { - // Only available starting with go 1.21 - return testing.Testing() -} diff --git a/vendor/github.com/spf13/cobra/completions.go b/vendor/github.com/spf13/cobra/completions.go index cedb4d7c..a1752f76 100644 --- a/vendor/github.com/spf13/cobra/completions.go +++ b/vendor/github.com/spf13/cobra/completions.go @@ -129,7 +129,7 @@ type CompletionOptions struct { type Completion = string // CompletionFunc is a function that provides completion results. -type CompletionFunc func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) +type CompletionFunc = func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) // CompletionWithDesc returns a [Completion] with a description by using the TAB delimited format. func CompletionWithDesc(choice string, description string) Completion { diff --git a/vendor/modules.txt b/vendor/modules.txt index 6db13d22..8037a406 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -133,7 +133,7 @@ github.com/shurcooL/githubv4 github.com/shurcooL/graphql github.com/shurcooL/graphql/ident github.com/shurcooL/graphql/internal/jsonutil -# github.com/spf13/cobra v1.9.0 +# github.com/spf13/cobra v1.9.1 ## explicit; go 1.15 github.com/spf13/cobra # github.com/spf13/pflag v1.0.6