diff --git a/go.mod b/go.mod index cfaf328571..0f3a7025ec 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.7.0 github.com/itchyny/gojq v0.12.17 - github.com/maxbrunsfeld/counterfeiter/v6 v6.11.2 + github.com/maxbrunsfeld/counterfeiter/v6 v6.11.3 github.com/mitchellh/hashstructure v1.1.0 github.com/mitchellh/mapstructure v1.5.0 github.com/onsi/ginkgo/v2 v2.23.4 diff --git a/go.sum b/go.sum index 809139c0b9..4da6767012 100644 --- a/go.sum +++ b/go.sum @@ -1793,8 +1793,8 @@ github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/go-sqlite3 v1.14.28 h1:ThEiQrnbtumT+QMknw63Befp/ce/nUPgBPMlRFEum7A= github.com/mattn/go-sqlite3 v1.14.28/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= -github.com/maxbrunsfeld/counterfeiter/v6 v6.11.2 h1:yVCLo4+ACVroOEr4iFU1iH46Ldlzz2rTuu18Ra7M8sU= -github.com/maxbrunsfeld/counterfeiter/v6 v6.11.2/go.mod h1:VzB2VoMh1Y32/QqDfg9ZJYHj99oM4LiGtqPZydTiQSQ= +github.com/maxbrunsfeld/counterfeiter/v6 v6.11.3 h1:Eaq36EIyJNp7b3qDhjV7jmDVq/yPeW2v4pTqzGbOGB4= +github.com/maxbrunsfeld/counterfeiter/v6 v6.11.3/go.mod h1:6KKUoQBZBW6PDXJtNfqeEjPXMj/ITTk+cWK9t9uS5+E= github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= diff --git a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/.gitignore b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/.gitignore index 1597f12b71..070b2a1fc9 100644 --- a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/.gitignore +++ b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/.gitignore @@ -30,3 +30,4 @@ integration/testdata/output *.profile *.bench /.vscode +.DS_Store diff --git a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md index db70f92c2d..dd36898987 100644 --- a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md +++ b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md @@ -20,25 +20,14 @@ If you are having problems with `counterfeiter` and are not using a supported ve Typically, `counterfeiter` is used in `go generate` directives. It can be frustrating when you change your interface declaration and suddenly all of your generated code is suddenly out-of-date. The best practice here is to use the [`go generate` command](https://blog.golang.org/generate) to make it easier to keep your test doubles up to date. -#### Step 1 - Create `tools.go` +⚠️ If you are working with go 1.23 or earlier, please refer to an [older version of this README](https://github.com/maxbrunsfeld/counterfeiter/blob/e39cbe6aaa94a0b6718cf3d413cd5319c3a1f6fa/README.md#using-counterfeiter), as the instructions below assume go 1.24 (which added `go tool` support) and later. -You can take a dependency on tools by creating a `tools.go` file, as described in [How can I track tool dependencies for a module?](https://go.dev/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module). This ensures that everyone working with your module is using the same version of each tool you use. +#### Step 1 - Add `counterfeiter` as a tool dependency -```shell -$ cat tools/tools.go -``` - -```go -//go:build tools +Establish a tool dependency on counterfeiter by running the following command: -package tools - -import ( - _ "github.com/maxbrunsfeld/counterfeiter/v6" -) - -// This file imports packages that are used when running go generate, or used -// during the development process but not otherwise depended on by built code. +```shell +go get -tool github.com/maxbrunsfeld/counterfeiter/v6 ``` #### Step 2a - Add `go:generate` Directives @@ -52,7 +41,7 @@ $ cat myinterface.go ```go package foo -//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . MySpecialInterface +//go:generate go tool counterfeiter . MySpecialInterface type MySpecialInterface interface { DoThings(string, uint64) (int, error) @@ -67,8 +56,8 @@ Writing `FakeMySpecialInterface` to `foofakes/fake_my_special_interface.go`... D #### Step 2b - Add `counterfeiter:generate` Directives If you plan to have many directives in a single package, consider using this -option. You can add directives right next to your interface definitions -(or not), in any `.go` file in your module. +option, as it will speed things up considerably. You can add directives right +next to your interface definitions (or not), in any `.go` file in your module. ```shell $ cat myinterface.go @@ -78,7 +67,7 @@ $ cat myinterface.go package foo // You only need **one** of these per package! -//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate +//go:generate go tool counterfeiter -generate // You will add lots of directives like these in the same package... //counterfeiter:generate . MySpecialInterface @@ -112,7 +101,7 @@ $ go generate ./... You can use the following command to invoke `counterfeiter` from within a go module: ```shell -$ go run github.com/maxbrunsfeld/counterfeiter/v6 +$ go tool counterfeiter USAGE counterfeiter @@ -153,7 +142,7 @@ type MySpecialInterface interface { ``` ```shell -$ go run github.com/maxbrunsfeld/counterfeiter/v6 path/to/foo MySpecialInterface +$ go tool counterfeiter path/to/foo MySpecialInterface Wrote `FakeMySpecialInterface` to `path/to/foo/foofakes/fake_my_special_interface.go` ``` @@ -196,7 +185,7 @@ For more examples of using the `counterfeiter` API, look at [some of the provide For third party interfaces, you can specify the interface using the alternative syntax `.`, for example: ```shell -$ go run github.com/maxbrunsfeld/counterfeiter/v6 github.com/go-redis/redis.Pipeliner +$ go tool counterfeiter github.com/go-redis/redis.Pipeliner ``` ### Running The Tests For `counterfeiter` diff --git a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/interface_template.go b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/interface_template.go index 3be9c1a5c3..3cd2ccfe5b 100644 --- a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/interface_template.go +++ b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/interface_template.go @@ -147,10 +147,6 @@ func (fake *{{$.Name}}{{$.GenericTypeParameters}}) {{Title .Name}}ReturnsOnCall( func (fake *{{.Name}}{{$.GenericTypeParameters}}) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - {{- range .Methods}} - fake.{{UnExport .Name}}Mutex.RLock() - defer fake.{{UnExport .Name}}Mutex.RUnlock() - {{- end}} copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/vendor/modules.txt b/vendor/modules.txt index efeff6480a..8972d0c61b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -427,8 +427,8 @@ github.com/mattn/go-isatty # github.com/mattn/go-sqlite3 v1.14.28 ## explicit; go 1.19 github.com/mattn/go-sqlite3 -# github.com/maxbrunsfeld/counterfeiter/v6 v6.11.2 -## explicit; go 1.23 +# github.com/maxbrunsfeld/counterfeiter/v6 v6.11.3 +## explicit; go 1.23.0 github.com/maxbrunsfeld/counterfeiter/v6 github.com/maxbrunsfeld/counterfeiter/v6/arguments github.com/maxbrunsfeld/counterfeiter/v6/command