diff --git a/.mockery.yaml b/.mockery.yaml index c5a68623b..f35904188 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -2,10 +2,18 @@ quiet: False disable-version-string: True with-expecter: True mockname: "{{.InterfaceName}}" -filename: "{{.MockName}}.go" +filename: "{{.MockName}}_mock.go" outpkg: mocks tags: "custom2" issue-845-fix: True +resolve-type-alias: False +_anchors: &inpackage_config + all: True + dir: "{{.InterfaceDir}}" + mockname: "Mock{{.InterfaceName}}" + outpkg: "{{.PackageName}}_test" + filename: "mock_{{.InterfaceNameSnake}}_test.go" + inpackage: False packages: github.com/vektra/mockery/v2/pkg/fixtures/buildtag/comment: config: @@ -72,21 +80,13 @@ packages: inpackage: True keeptree: False github.com/vektra/mockery/v2/pkg/fixtures/iface_typed_param: - config: - all: True - dir: "{{.InterfaceDir}}" - mockname: "{{.InterfaceName}}" - outpkg: "{{.PackageName}}_test" - filename: "{{.InterfaceNameSnake}}_mock_test.go" - keeptree: True + config: *inpackage_config + github.com/vektra/mockery/v2/pkg/fixtures/example_project: + config: *inpackage_config github.com/vektra/mockery/v2/pkg/fixtures/issue845: - config: - all: True - dir: "{{.InterfaceDir}}" - mockname: "{{.InterfaceName}}" - outpkg: "{{.PackageName}}_test" + config: + <<: *inpackage_config filename: "mock_{{.MockName}}_test.go" - inpackage: True interfaces: Interface: configs: @@ -94,3 +94,18 @@ packages: mockname: WithoutFix - issue-845-fix: True mockname: WithFix + github.com/vektra/mockery/v2/pkg/fixtures/type_alias: + config: + all: True + dir: "{{.InterfaceDir}}" + filename: "mock_{{.MockName}}_test.go" + outpkg: "{{.PackageName}}_test" + inpackage: False + interfaces: + Interface1: + configs: + - resolve-type-alias: False + mockname: InterfaceWithUnresolvedAlias + - resolve-type-alias: True + mockname: InterfaceWithResolvedAlias + diff --git a/Taskfile.yml b/Taskfile.yml index 8c6ff4c0c..315fa298a 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -21,7 +21,7 @@ tasks: mocks.remove: desc: remove all mock files cmds: - - find . -name '*_mock.go' | xargs -r rm + - find . -name '*_mock.go' -o -name 'mock_*_test.go' | xargs -r rm - rm -rf mocks/ mocks.generate: diff --git a/cmd/mockery.go b/cmd/mockery.go index ac0b77373..7e22db43c 100644 --- a/cmd/mockery.go +++ b/cmd/mockery.go @@ -377,6 +377,7 @@ func (r *RootApp) Run() error { UnrollVariadic: r.Config.UnrollVariadic, WithExpecter: r.Config.WithExpecter, ReplaceType: r.Config.ReplaceType, + ResolveTypeAlias: r.Config.ResolveTypeAlias, }, osp, r.Config.DryRun) generated := walker.Walk(ctx, visitor) diff --git a/docs/deprecations.md b/docs/deprecations.md index 6babcff6d..ee42996df 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -36,3 +36,19 @@ issue-845-fix: True After this is done, mocks generated in the old scheme will properly respect the `#!yaml outpkg:` parameter previously set if being generated with `#!yaml inpackage: True`. + +`resolve-type-alias` +-------------------- + +This parameter directs Mockery on whether it should resolve a type alias to its underlying, real +type or if it should generate mocks by referencing. Mockery was changed in [#808](https://github.com/vektra/mockery/pull/808) +to support a new language feature that exposed type aliases in the parsed syntax tree. This meant +that Mockery was now explicitly aware of aliases, which fixed a number of problems: + +- [#803](https://github.com/vektra/mockery/pull/803) +- [#331](https://github.com/vektra/mockery/issues/331) + +However, it was discovered in [#839](https://github.com/vektra/mockery/issues/839) that this was in fact a backwards-incompatible change. Thus, to maintain backwards compatability guarantees, we created this parameter that will be set to `True` by default. + +For all new projects that use Mockery, there is no reason to resolve type aliases so this parameter should almost always +be set to `False`. This will be the permanent behavior in Mockery v3. diff --git a/go.sum b/go.sum index ffdbb4b5c..82fb22427 100644 --- a/go.sum +++ b/go.sum @@ -104,8 +104,9 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -257,8 +258,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -309,8 +310,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -349,8 +350,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -360,8 +361,8 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -412,8 +413,8 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go.work.sum b/go.work.sum index 69fece70e..5aa22c175 100644 --- a/go.work.sum +++ b/go.work.sum @@ -19,6 +19,7 @@ cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFO cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk= cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= cloud.google.com/go v0.112.2/go.mod h1:iEqjp//KquGIJV/m+Pk3xecgKNhV+ry+vVTsy4TbDms= cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E= cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= @@ -166,6 +167,7 @@ cloud.google.com/go/compute v1.14.0 h1:hfm2+FfxVmnRlh6LpB7cg1ZNU+5edAHmW679JePzt cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= +cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= cloud.google.com/go/compute v1.27.4 h1:XM8ulx6crjdl09XBfji7viFgZOEQuIxBwKmjRH9Rtmc= cloud.google.com/go/compute v1.27.4/go.mod h1:7JZS+h21ERAGHOy5qb7+EPyXlQwzshzrx1x6L9JhTqU= @@ -294,6 +296,7 @@ cloud.google.com/go/filestore v1.8.7/go.mod h1:dKfyH0YdPAKdYHqAR/bxZeil85Y5QmrEV cloud.google.com/go/firestore v1.9.0 h1:IBlRyxgGySXu5VuW0RgGFlTtLukSnNkpDiEOMkQkmpA= cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= cloud.google.com/go/firestore v1.14.0/go.mod h1:96MVaHLsEhbvkBEdZgfN+AS/GIkco1LRpH9Xp9YZfzQ= +cloud.google.com/go/firestore v1.15.0/go.mod h1:GWOxFXcv8GZUtYpWHw/w6IuYNux/BtmeVTMmjrm4yhk= cloud.google.com/go/firestore v1.16.0 h1:YwmDHcyrxVRErWcgxunzEaZxtNbc8QoFYA/JOEwDPgc= cloud.google.com/go/firestore v1.16.0/go.mod h1:+22v/7p+WNBSQwdSwP57vz47aZiY+HrDkrOsJNhk7rg= cloud.google.com/go/functions v1.9.0 h1:35tgv1fQOtvKqH/uxJMzX3w6usneJ0zXpsFr9KAVhNE= @@ -380,6 +383,7 @@ cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+ cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= cloud.google.com/go/longrunning v0.5.0/go.mod h1:0JNuqRShmscVAhIACGtskSAWtqtOoPkwP0YF1oVEchc= cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= +cloud.google.com/go/longrunning v0.5.5/go.mod h1:WV2LAxD8/rg5Z1cNW6FJ/ZpX4E4VnDnoTk0yawPBB7s= cloud.google.com/go/longrunning v0.5.6/go.mod h1:vUaDrWYOMKRuhiv6JBnn49YxCPz2Ayn9GqyjaBT8/mA= cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng= cloud.google.com/go/longrunning v0.5.9/go.mod h1:HD+0l9/OOW0za6UWdKJtXoFAX/BGg/3Wj8p10NeWF7c= @@ -705,6 +709,7 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -787,11 +792,12 @@ github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/firefart/nonamedreturns v1.0.5 h1:tM+Me2ZaXs8tfdDw3X6DOX++wMCOqzYUho6tUTYIdRA= -github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghostiam/protogetter v0.3.6 h1:R7qEWaSgFCsy20yYHNIJsU9ZOb8TziSRRxuAOTVKeOk= @@ -858,7 +864,6 @@ github.com/google/generative-ai-go v0.17.0 h1:kUmCXUIwJouD7I7ev3OmxzzQVICyhIWAxa github.com/google/generative-ai-go v0.17.0/go.mod h1:JYolL13VG7j79kM5BtHz4qwONHkeJQzOCkKXnpqtS/E= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9 h1:OF1IPgv+F4NmqmJ98KTjdN97Vs1JxDPB3vbmYzV2dpk= github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= @@ -929,8 +934,10 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjd github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= github.com/hashicorp/consul/api v1.18.0 h1:R7PPNzTCeN6VuQNDwwhZWJvzCtGSrNpJqfb22h3yH9g= github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4NM6p/k+d03q2v4= +github.com/hashicorp/consul/api v1.28.2/go.mod h1:KyzqzgMEya+IZPcD65YFoOVAgPpbfERu4I/tzG6/ueE= github.com/hashicorp/consul/sdk v0.13.0 h1:lce3nFlpv8humJL8rNrrGHYSKc3q+Kxfeg3Ii1m6ZWU= github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -938,6 +945,7 @@ github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/S github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -999,6 +1007,7 @@ github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= @@ -1059,6 +1068,9 @@ github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKH github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5 h1:0KqC6/sLy7fDpBdybhVkkv4Yz+PmB7c9Dz9z3dLW804= github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= +github.com/nats-io/nats.go v1.34.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= +github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= github.com/nunnatsa/ginkgolinter v0.16.2 h1:8iLqHIZvN4fTLDC0Ke9tbSZVcyVHoBs0HIbnVSxfHJk= github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= @@ -1115,6 +1127,8 @@ github.com/ryanuber/columnize v2.1.0+incompatible h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUW github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.9.0 h1:fipzMFW34hFUEc4D7fsLQFtE7yElkpgyS2zruedRdZk= github.com/sagikazarmark/crypt v0.9.0/go.mod h1:RnH7sEhxfdnPm1z+XMgSLjWTEIjyK4z2dw6+4vHTMuo= +github.com/sagikazarmark/crypt v0.19.0/go.mod h1:c6vimRziqqERhtSe0MhIvzE1w54FrCHtrXb5NH/ja78= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI= @@ -1134,9 +1148,11 @@ github.com/sivchari/tenv v1.10.0 h1:g/hzMA+dBCKqGXgW8AV/1xIWhAvDrx0zFKNR48NFMg0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/tetafro/godot v1.4.16 h1:4ChfhveiNLk4NveAZ9Pu2AN8QZ2nkUGFuadM9lrr5D0= @@ -1183,12 +1199,16 @@ go.einride.tech/aip v0.67.1 h1:d/4TW92OxXBngkSOwWS2CH5rez869KpKMaN44mdxkFI= go.einride.tech/aip v0.67.1/go.mod h1:ZGX4/zKw8dcgzdLsrvpOOGxfxI2QSk12SlP7d6c0/XI= go.etcd.io/etcd/api/v3 v3.5.6 h1:Cy2qx3npLcYqTKqGJzMypnMv2tiRyifZJ17BlWIWA7A= go.etcd.io/etcd/api/v3 v3.5.6/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= +go.etcd.io/etcd/api/v3 v3.5.12/go.mod h1:Ot+o0SWSyT6uHhA56al1oCED0JImsRiU9Dc26+C2a+4= go.etcd.io/etcd/client/pkg/v3 v3.5.6 h1:TXQWYceBKqLp4sa87rcPs11SXxUA/mHwH975v+BDvLU= go.etcd.io/etcd/client/pkg/v3 v3.5.6/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ= +go.etcd.io/etcd/client/pkg/v3 v3.5.12/go.mod h1:seTzl2d9APP8R5Y2hFL3NVlD6qC/dOT+3kvrqPyTas4= go.etcd.io/etcd/client/v2 v2.305.6 h1:fIDR0p4KMjw01MJMfUIDWdQbjo06PD6CeYM5z4EHLi0= go.etcd.io/etcd/client/v2 v2.305.6/go.mod h1:BHha8XJGe8vCIBfWBpbBLVZ4QjOIlfoouvOwydu63E0= +go.etcd.io/etcd/client/v2 v2.305.12/go.mod h1:aQ/yhsxMu+Oht1FOupSr60oBvcS9cKXHrzBpDsPTf9E= go.etcd.io/etcd/client/v3 v3.5.6 h1:coLs69PWCXE9G4FKquzNaSHrRyMCAXwF+IX1tAPVO8E= go.etcd.io/etcd/client/v3 v3.5.6/go.mod h1:f6GRinRMCsFVv9Ht42EyY7nfsVGwrNO0WEoS2pRKzQk= +go.etcd.io/etcd/client/v3 v3.5.12/go.mod h1:tSbBCakoWmmddL+BKVAJHa9km+O/E+bumDe9mSbPiqw= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= @@ -1221,6 +1241,7 @@ go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= @@ -1234,17 +1255,20 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1270,12 +1294,14 @@ golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -1340,7 +1366,6 @@ golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= @@ -1355,12 +1380,12 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1374,7 +1399,7 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= @@ -1412,6 +1437,7 @@ google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/ google.golang.org/api v0.128.0/go.mod h1:Y611qgqaE92On/7g65MQgxYul3c0rEB894kniWLY750= google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI= google.golang.org/api v0.152.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= +google.golang.org/api v0.171.0/go.mod h1:Hnq5AHm4OTMt2BUVjael2CWZFD6vksJdWCWiUAmjC9o= google.golang.org/api v0.177.0/go.mod h1:srbhue4MLjkjbkux5p3dw/ocYOSZTaIEvf7bCOnFQDw= google.golang.org/api v0.178.0/go.mod h1:84/k2v8DFpDRebpGcooklv/lais3MEfqpaBLA12gl2U= google.golang.org/api v0.183.0/go.mod h1:q43adC5/pHoSZTx5h2mSmdF7NcyfW9JuDyIOJAgS9ZQ= @@ -1477,6 +1503,7 @@ google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda/go.mod h1:g2LLCvCeCSir/JJSWosk19BR4NVxGqHUC6rxIRsd7Aw= google.golang.org/genproto v0.0.0-20240528184218-531527333157/go.mod h1:ubQlAQnzejB8uZzszhrTCU2Fyp6Vi7ZE5nn0c3W8+qQ= google.golang.org/genproto v0.0.0-20240722135656-d784300faade/go.mod h1:FfBgJBJg9GcpPvKIuHSZ/aE1g2ecGL74upMzGZjiGEY= @@ -1487,6 +1514,7 @@ google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go. google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405/go.mod h1:oT32Z4o8Zv2xPQTg0pbVaPr0MPOH6f14RgXt7zfIpwg= google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y= google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= google.golang.org/genproto/googleapis/api v0.0.0-20240429193739-8cf5692501f6/go.mod h1:10yRODfgim2/T8csjQsMPgZOMvtytXKTDRzH6HRGzRw= google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae/go.mod h1:FfiGhwUm6CJviekPrc0oJ+7h29e+DmWU6UtjX0ZvI7Y= @@ -1502,6 +1530,7 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240429193739-8cf5692501f6/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= @@ -1536,6 +1565,7 @@ google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= diff --git a/mocks/github.com/vektra/mockery/v2/pkg/TypesPackage.go b/mocks/github.com/vektra/mockery/v2/pkg/TypesPackage_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/TypesPackage.go rename to mocks/github.com/vektra/mockery/v2/pkg/TypesPackage_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/A.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/A_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/A.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/A_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/AsyncProducer.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/AsyncProducer_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/AsyncProducer.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/AsyncProducer_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Blank.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Blank_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Blank.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Blank_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ConsulLock.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ConsulLock_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/ConsulLock.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/ConsulLock_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/EmbeddedGet.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/EmbeddedGet_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/EmbeddedGet.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/EmbeddedGet_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Example.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Example_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Example.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Example_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ExpecterAndRolledVariadic.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ExpecterAndRolledVariadic_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/ExpecterAndRolledVariadic.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/ExpecterAndRolledVariadic_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Expecter.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Expecter_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Expecter.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Expecter_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Fooer.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Fooer_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Fooer.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Fooer_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/FuncArgsCollision.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/FuncArgsCollision_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/FuncArgsCollision.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/FuncArgsCollision_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GenericInterface.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GenericInterface_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/GenericInterface.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/GenericInterface_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetGeneric.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetGeneric_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetGeneric.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetGeneric_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetInt.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetInt_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetInt.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetInt_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/HasConflictingNestedImports.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/HasConflictingNestedImports_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/HasConflictingNestedImports.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/HasConflictingNestedImports_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ImportsSameAsPackage.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ImportsSameAsPackage_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/ImportsSameAsPackage.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/ImportsSameAsPackage_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/InstantiatedGenericInterface.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/InstantiatedGenericInterface_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/InstantiatedGenericInterface.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/InstantiatedGenericInterface_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Issue766.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Issue766_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Issue766.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Issue766_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/KeyManager.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/KeyManager_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/KeyManager.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/KeyManager_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapFunc.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapFunc_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapFunc.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapFunc_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapToInterface.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapToInterface_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapToInterface.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapToInterface_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MyReader.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MyReader_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/MyReader.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/MyReader_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/PanicOnNoReturnValue.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/PanicOnNoReturnValue_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/PanicOnNoReturnValue.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/PanicOnNoReturnValue_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ReplaceGenericSelf.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ReplaceGenericSelf_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/ReplaceGenericSelf.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/ReplaceGenericSelf_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ReplaceGeneric.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ReplaceGeneric_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/ReplaceGeneric.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/ReplaceGeneric_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester2.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester2_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester2.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester2_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester3.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester3_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester3.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester3_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester4.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester4_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester4.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester4_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsImport.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsImport_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsImport.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsImport_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsNamedImport.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsNamedImport_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsNamedImport.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsNamedImport_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsPkg.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsPkg_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsPkg.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsPkg_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArray.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArray_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArray.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArray_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterElided.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterElided_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterElided.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterElided_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterGenerics.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterGenerics_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterGenerics.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterGenerics_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterIface.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterIface_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterIface.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterIface_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterNS.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterNS_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterNS.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterNS_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterPtr.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterPtr_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterPtr.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterPtr_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterReturnElided.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterReturnElided_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterReturnElided.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterReturnElided_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterSlice.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterSlice_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterSlice.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterSlice_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadicOneArgument.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadicOneArgument_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadicOneArgument.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadicOneArgument_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadic.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadic_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadic.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadic_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/SendFunc.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/SendFunc_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/SendFunc.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/SendFunc_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Sibling.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Sibling_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Sibling.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Sibling_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/StructWithTag.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/StructWithTag_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/StructWithTag.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/StructWithTag_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/UnsafeInterface.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/UnsafeInterface_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/UnsafeInterface.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/UnsafeInterface_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/UsesAny.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/UsesAny_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/UsesAny.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/UsesAny_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/UsesOtherPkgIface.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/UsesOtherPkgIface_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/UsesOtherPkgIface.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/UsesOtherPkgIface_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/VariadicNoReturnInterface.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/VariadicNoReturnInterface_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/VariadicNoReturnInterface.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/VariadicNoReturnInterface_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/VariadicReturnFunc.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/VariadicReturnFunc_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/VariadicReturnFunc.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/VariadicReturnFunc_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Variadic.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Variadic_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/Variadic.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/Variadic_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/buildtag/comment/IfaceWithCustomBuildTagInComment.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/buildtag/comment/IfaceWithCustomBuildTagInComment_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/buildtag/comment/IfaceWithCustomBuildTagInComment.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/buildtag/comment/IfaceWithCustomBuildTagInComment_mock.go diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/requesterUnexported.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/requesterUnexported_mock.go similarity index 100% rename from mocks/github.com/vektra/mockery/v2/pkg/fixtures/requesterUnexported.go rename to mocks/github.com/vektra/mockery/v2/pkg/fixtures/requesterUnexported_mock.go diff --git a/pkg/config/config.go b/pkg/config/config.go index 7ff9d5ad9..72b231e34 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -33,7 +33,8 @@ type Interface struct { type Config struct { All bool `mapstructure:"all"` - MockBuildTags string `mapstructure:"mock-build-tags"` + Anchors map[string]any `mapstructure:"_anchors"` + BoilerplateFile string `mapstructure:"boilerplate-file"` BuildTags string `mapstructure:"tags"` Case string `mapstructure:"case"` Config string `mapstructure:"config"` @@ -43,39 +44,39 @@ type Config struct { DisableFuncMocks bool `mapstructure:"disable-func-mocks"` DisableVersionString bool `mapstructure:"disable-version-string"` DryRun bool `mapstructure:"dry-run"` + Exclude []string `mapstructure:"exclude"` ExcludeRegex string `mapstructure:"exclude-regex"` Exported bool `mapstructure:"exported"` FileName string `mapstructure:"filename"` - IncludeAutoGenerated bool `mapstructure:"include-auto-generated"` - IncludeRegex string `mapstructure:"include-regex"` InPackage bool `mapstructure:"inpackage"` InPackageSuffix bool `mapstructure:"inpackage-suffix"` + IncludeAutoGenerated bool `mapstructure:"include-auto-generated"` + IncludeRegex string `mapstructure:"include-regex"` Issue845Fix bool `mapstructure:"issue-845-fix"` KeepTree bool `mapstructure:"keeptree"` LogLevel string `mapstructure:"log-level"` + MockBuildTags string `mapstructure:"mock-build-tags"` MockName string `mapstructure:"mockname"` Name string `mapstructure:"name"` Note string `mapstructure:"note"` Outpkg string `mapstructure:"outpkg"` Output string `mapstructure:"output"` - Packages map[string]interface{} `mapstructure:"packages"` Packageprefix string `mapstructure:"packageprefix"` + Packages map[string]interface{} `mapstructure:"packages"` Print bool `mapstructure:"print"` Profile string `mapstructure:"profile"` Quiet bool `mapstructure:"quiet"` Recursive bool `mapstructure:"recursive"` - Exclude []string `mapstructure:"exclude"` + ReplaceType []string `mapstructure:"replace-type"` + ResolveTypeAlias bool `mapstructure:"resolve-type-alias"` SrcPkg string `mapstructure:"srcpkg"` - BoilerplateFile string `mapstructure:"boilerplate-file"` // StructName overrides the name given to the mock struct and should only be nonempty // when generating for an exact match (non regex expression in -name). - StructName string `mapstructure:"structname"` - TestOnly bool `mapstructure:"testonly"` - UnrollVariadic bool `mapstructure:"unroll-variadic"` - Version bool `mapstructure:"version"` - WithExpecter bool `mapstructure:"with-expecter"` - ReplaceType []string `mapstructure:"replace-type"` - + StructName string `mapstructure:"structname"` + TestOnly bool `mapstructure:"testonly"` + UnrollVariadic bool `mapstructure:"unroll-variadic"` + Version bool `mapstructure:"version"` + WithExpecter bool `mapstructure:"with-expecter"` // Viper throws away case-sensitivity when it marshals into this struct. This // destroys necessary information we need, specifically around interface names. // So, we re-read the config into this map outside of viper. @@ -95,10 +96,12 @@ func NewConfigFromViper(v *viper.Viper) (*Config, error) { } // Set defaults + v.SetDefault("resolve-type-alias", true) if len(packageList) == 0 { v.SetDefault("case", "camel") v.SetDefault("dir", ".") v.SetDefault("output", "./mocks") + } else { v.SetDefault("dir", "mocks/{{.PackagePath}}") v.SetDefault("filename", "mock_{{.InterfaceName}}.go") diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 9001a9201..2a8ea5edd 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -921,9 +921,10 @@ func TestNewConfigFromViper(t *testing.T) { return viper.New() }, want: &Config{ - Case: "camel", - Dir: ".", - Output: "./mocks", + Case: "camel", + Dir: ".", + Output: "./mocks", + ResolveTypeAlias: true, }, }, { @@ -940,6 +941,7 @@ packages: Outpkg: "{{.PackageName}}", WithExpecter: true, LogLevel: "info", + ResolveTypeAlias: true, }, }, { @@ -958,6 +960,7 @@ packages: Outpkg: "{{.PackageName}}", WithExpecter: true, LogLevel: "info", + ResolveTypeAlias: true, }, }, } @@ -991,7 +994,7 @@ packages: tt.want._cfgAsMap = nil if !reflect.DeepEqual(got, tt.want) { - t.Errorf("NewConfigFromViper() = %v, want %v", got, tt.want) + t.Errorf("NewConfigFromViper() = %+v, want %+v", got, tt.want) } }) } diff --git a/pkg/fixtures/example_project/mock_root_test.go b/pkg/fixtures/example_project/mock_root_test.go new file mode 100644 index 000000000..7ab383281 --- /dev/null +++ b/pkg/fixtures/example_project/mock_root_test.go @@ -0,0 +1,125 @@ +// Code generated by mockery. DO NOT EDIT. + +package example_project_test + +import ( + mock "github.com/stretchr/testify/mock" + foo "github.com/vektra/mockery/v2/pkg/fixtures/example_project/foo" +) + +// MockRoot is an autogenerated mock type for the Root type +type MockRoot struct { + mock.Mock +} + +type MockRoot_Expecter struct { + mock *mock.Mock +} + +func (_m *MockRoot) EXPECT() *MockRoot_Expecter { + return &MockRoot_Expecter{mock: &_m.Mock} +} + +// ReturnsFoo provides a mock function with given fields: +func (_m *MockRoot) ReturnsFoo() (foo.Foo, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ReturnsFoo") + } + + var r0 foo.Foo + var r1 error + if rf, ok := ret.Get(0).(func() (foo.Foo, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() foo.Foo); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(foo.Foo) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockRoot_ReturnsFoo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReturnsFoo' +type MockRoot_ReturnsFoo_Call struct { + *mock.Call +} + +// ReturnsFoo is a helper method to define mock.On call +func (_e *MockRoot_Expecter) ReturnsFoo() *MockRoot_ReturnsFoo_Call { + return &MockRoot_ReturnsFoo_Call{Call: _e.mock.On("ReturnsFoo")} +} + +func (_c *MockRoot_ReturnsFoo_Call) Run(run func()) *MockRoot_ReturnsFoo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockRoot_ReturnsFoo_Call) Return(_a0 foo.Foo, _a1 error) *MockRoot_ReturnsFoo_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockRoot_ReturnsFoo_Call) RunAndReturn(run func() (foo.Foo, error)) *MockRoot_ReturnsFoo_Call { + _c.Call.Return(run) + return _c +} + +// TakesBaz provides a mock function with given fields: _a0 +func (_m *MockRoot) TakesBaz(_a0 *foo.Baz) { + _m.Called(_a0) +} + +// MockRoot_TakesBaz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TakesBaz' +type MockRoot_TakesBaz_Call struct { + *mock.Call +} + +// TakesBaz is a helper method to define mock.On call +// - _a0 *foo.Baz +func (_e *MockRoot_Expecter) TakesBaz(_a0 interface{}) *MockRoot_TakesBaz_Call { + return &MockRoot_TakesBaz_Call{Call: _e.mock.On("TakesBaz", _a0)} +} + +func (_c *MockRoot_TakesBaz_Call) Run(run func(_a0 *foo.Baz)) *MockRoot_TakesBaz_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*foo.Baz)) + }) + return _c +} + +func (_c *MockRoot_TakesBaz_Call) Return() *MockRoot_TakesBaz_Call { + _c.Call.Return() + return _c +} + +func (_c *MockRoot_TakesBaz_Call) RunAndReturn(run func(*foo.Baz)) *MockRoot_TakesBaz_Call { + _c.Call.Return(run) + return _c +} + +// NewMockRoot creates a new instance of MockRoot. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockRoot(t interface { + mock.TestingT + Cleanup(func()) +}) *MockRoot { + mock := &MockRoot{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/fixtures/example_project/mock_Stringer_test.go b/pkg/fixtures/example_project/mock_stringer_test.go similarity index 82% rename from pkg/fixtures/example_project/mock_Stringer_test.go rename to pkg/fixtures/example_project/mock_stringer_test.go index 4521254de..ceeaa277e 100644 --- a/pkg/fixtures/example_project/mock_Stringer_test.go +++ b/pkg/fixtures/example_project/mock_stringer_test.go @@ -1,6 +1,6 @@ // Code generated by mockery. DO NOT EDIT. -package example_project +package example_project_test import mock "github.com/stretchr/testify/mock" @@ -21,6 +21,10 @@ func (_m *MockStringer) EXPECT() *MockStringer_Expecter { func (_m *MockStringer) String() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for String") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -53,13 +57,17 @@ func (_c *MockStringer_String_Call) Return(_a0 string) *MockStringer_String_Call return _c } -type mockConstructorTestingTNewMockStringer interface { - mock.TestingT - Cleanup(func()) +func (_c *MockStringer_String_Call) RunAndReturn(run func() string) *MockStringer_String_Call { + _c.Call.Return(run) + return _c } // NewMockStringer creates a new instance of MockStringer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockStringer(t mockConstructorTestingTNewMockStringer) *MockStringer { +// The first argument is typically a *testing.T value. +func NewMockStringer(t interface { + mock.TestingT + Cleanup(func()) +}) *MockStringer { mock := &MockStringer{} mock.Mock.Test(t) diff --git a/pkg/fixtures/example_project/string_test.go b/pkg/fixtures/example_project/string_test.go index 5cef683eb..240d45b48 100644 --- a/pkg/fixtures/example_project/string_test.go +++ b/pkg/fixtures/example_project/string_test.go @@ -1,12 +1,13 @@ -package example_project +package example_project_test import ( "testing" "github.com/stretchr/testify/assert" + "github.com/vektra/mockery/v2/pkg/fixtures/example_project" ) -func Foo(s Stringer) string { +func Foo(s example_project.Stringer) string { return s.String() } diff --git a/pkg/fixtures/iface_typed_param/getter_iface_typed_param_mock_test.go b/pkg/fixtures/iface_typed_param/getter_iface_typed_param_mock_test.go deleted file mode 100644 index 0d2223c25..000000000 --- a/pkg/fixtures/iface_typed_param/getter_iface_typed_param_mock_test.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package iface_typed_param_test - -import ( - io "io" - - mock "github.com/stretchr/testify/mock" -) - -// GetterIfaceTypedParam is an autogenerated mock type for the GetterIfaceTypedParam type -type GetterIfaceTypedParam[T io.Reader] struct { - mock.Mock -} - -type GetterIfaceTypedParam_Expecter[T io.Reader] struct { - mock *mock.Mock -} - -func (_m *GetterIfaceTypedParam[T]) EXPECT() *GetterIfaceTypedParam_Expecter[T] { - return &GetterIfaceTypedParam_Expecter[T]{mock: &_m.Mock} -} - -// Get provides a mock function with given fields: -func (_m *GetterIfaceTypedParam[T]) Get() T { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 T - if rf, ok := ret.Get(0).(func() T); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(T) - } - } - - return r0 -} - -// GetterIfaceTypedParam_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type GetterIfaceTypedParam_Get_Call[T io.Reader] struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -func (_e *GetterIfaceTypedParam_Expecter[T]) Get() *GetterIfaceTypedParam_Get_Call[T] { - return &GetterIfaceTypedParam_Get_Call[T]{Call: _e.mock.On("Get")} -} - -func (_c *GetterIfaceTypedParam_Get_Call[T]) Run(run func()) *GetterIfaceTypedParam_Get_Call[T] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *GetterIfaceTypedParam_Get_Call[T]) Return(_a0 T) *GetterIfaceTypedParam_Get_Call[T] { - _c.Call.Return(_a0) - return _c -} - -func (_c *GetterIfaceTypedParam_Get_Call[T]) RunAndReturn(run func() T) *GetterIfaceTypedParam_Get_Call[T] { - _c.Call.Return(run) - return _c -} - -// NewGetterIfaceTypedParam creates a new instance of GetterIfaceTypedParam. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewGetterIfaceTypedParam[T io.Reader](t interface { - mock.TestingT - Cleanup(func()) -}) *GetterIfaceTypedParam[T] { - mock := &GetterIfaceTypedParam[T]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/fixtures/iface_typed_param/main_test.go b/pkg/fixtures/iface_typed_param/main_test.go index 01c5f44bd..1dee4e1ce 100644 --- a/pkg/fixtures/iface_typed_param/main_test.go +++ b/pkg/fixtures/iface_typed_param/main_test.go @@ -20,7 +20,7 @@ func TestIfaceWithIfaceTypedParamReturnValues(t *testing.T) { } for _, test := range tests { t.Run(test.name, func(st *testing.T) { - m := NewGetterIfaceTypedParam[*bufio.Reader](st) + m := NewMockGetterIfaceTypedParam[*bufio.Reader](st) m.EXPECT().Get().Return(test.returnVal) assert.Equal(st, test.returnVal, m.Get()) diff --git a/pkg/fixtures/iface_typed_param/mock_getter_iface_typed_param_test.go b/pkg/fixtures/iface_typed_param/mock_getter_iface_typed_param_test.go new file mode 100644 index 000000000..7731d5fd8 --- /dev/null +++ b/pkg/fixtures/iface_typed_param/mock_getter_iface_typed_param_test.go @@ -0,0 +1,83 @@ +// Code generated by mockery. DO NOT EDIT. + +package iface_typed_param_test + +import ( + io "io" + + mock "github.com/stretchr/testify/mock" +) + +// MockGetterIfaceTypedParam is an autogenerated mock type for the GetterIfaceTypedParam type +type MockGetterIfaceTypedParam[T io.Reader] struct { + mock.Mock +} + +type MockGetterIfaceTypedParam_Expecter[T io.Reader] struct { + mock *mock.Mock +} + +func (_m *MockGetterIfaceTypedParam[T]) EXPECT() *MockGetterIfaceTypedParam_Expecter[T] { + return &MockGetterIfaceTypedParam_Expecter[T]{mock: &_m.Mock} +} + +// Get provides a mock function with given fields: +func (_m *MockGetterIfaceTypedParam[T]) Get() T { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 T + if rf, ok := ret.Get(0).(func() T); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(T) + } + } + + return r0 +} + +// MockGetterIfaceTypedParam_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockGetterIfaceTypedParam_Get_Call[T io.Reader] struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +func (_e *MockGetterIfaceTypedParam_Expecter[T]) Get() *MockGetterIfaceTypedParam_Get_Call[T] { + return &MockGetterIfaceTypedParam_Get_Call[T]{Call: _e.mock.On("Get")} +} + +func (_c *MockGetterIfaceTypedParam_Get_Call[T]) Run(run func()) *MockGetterIfaceTypedParam_Get_Call[T] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockGetterIfaceTypedParam_Get_Call[T]) Return(_a0 T) *MockGetterIfaceTypedParam_Get_Call[T] { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGetterIfaceTypedParam_Get_Call[T]) RunAndReturn(run func() T) *MockGetterIfaceTypedParam_Get_Call[T] { + _c.Call.Return(run) + return _c +} + +// NewMockGetterIfaceTypedParam creates a new instance of MockGetterIfaceTypedParam. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockGetterIfaceTypedParam[T io.Reader](t interface { + mock.TestingT + Cleanup(func()) +}) *MockGetterIfaceTypedParam[T] { + mock := &MockGetterIfaceTypedParam[T]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/fixtures/issue845/mock_WithoutFix_test.go b/pkg/fixtures/issue845/mock_WithoutFix_test.go index dd1adff4b..0cbfaf5d1 100644 --- a/pkg/fixtures/issue845/mock_WithoutFix_test.go +++ b/pkg/fixtures/issue845/mock_WithoutFix_test.go @@ -1,6 +1,6 @@ // Code generated by mockery. DO NOT EDIT. -package issue845 +package issue845_test import mock "github.com/stretchr/testify/mock" diff --git a/pkg/fixtures/type_alias/interface.go b/pkg/fixtures/type_alias/interface.go new file mode 100644 index 000000000..95b16766c --- /dev/null +++ b/pkg/fixtures/type_alias/interface.go @@ -0,0 +1,7 @@ +package type_alias + +type Type = int + +type Interface1 interface { + Foo() Type +} diff --git a/pkg/fixtures/type_alias/interface_test.go b/pkg/fixtures/type_alias/interface_test.go new file mode 100644 index 000000000..c8d545ced --- /dev/null +++ b/pkg/fixtures/type_alias/interface_test.go @@ -0,0 +1,39 @@ +package type_alias_test + +import ( + "regexp" + "testing" + + "github.com/chigopher/pathlib" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestTypeAlias(t *testing.T) { + for _, tt := range []struct { + name string + filepath string + expectedRegex string + }{ + { + name: "With alias resolved", + filepath: "./mock_InterfaceWithResolvedAlias_test.go", + expectedRegex: `func \((_?[a-zA-Z]*)+ \*InterfaceWithResolvedAlias\) Foo\(\) int {`, + }, + { + name: "With alias unresolved", + filepath: "./mock_InterfaceWithUnresolvedAlias_test.go", + expectedRegex: `func \((_?[a-zA-Z]*)+ \*InterfaceWithUnresolvedAlias\) Foo\(\) type_alias.Type {`, + }, + } { + t.Run(tt.name, func(t *testing.T) { + regex, err := regexp.Compile(tt.expectedRegex) + require.NoError(t, err) + path := pathlib.NewPath(tt.filepath) + bytes, err := path.ReadFile() + require.NoError(t, err) + + assert.True(t, regex.Match(bytes), "expected regex was not found in file") + }) + } +} diff --git a/pkg/fixtures/type_alias/mock_InterfaceWithResolvedAlias_test.go b/pkg/fixtures/type_alias/mock_InterfaceWithResolvedAlias_test.go new file mode 100644 index 000000000..a0594b93f --- /dev/null +++ b/pkg/fixtures/type_alias/mock_InterfaceWithResolvedAlias_test.go @@ -0,0 +1,77 @@ +// Code generated by mockery. DO NOT EDIT. + +package type_alias_test + +import mock "github.com/stretchr/testify/mock" + +// InterfaceWithResolvedAlias is an autogenerated mock type for the Interface1 type +type InterfaceWithResolvedAlias struct { + mock.Mock +} + +type InterfaceWithResolvedAlias_Expecter struct { + mock *mock.Mock +} + +func (_m *InterfaceWithResolvedAlias) EXPECT() *InterfaceWithResolvedAlias_Expecter { + return &InterfaceWithResolvedAlias_Expecter{mock: &_m.Mock} +} + +// Foo provides a mock function with given fields: +func (_m *InterfaceWithResolvedAlias) Foo() int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Foo") + } + + var r0 int + if rf, ok := ret.Get(0).(func() int); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int) + } + + return r0 +} + +// InterfaceWithResolvedAlias_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' +type InterfaceWithResolvedAlias_Foo_Call struct { + *mock.Call +} + +// Foo is a helper method to define mock.On call +func (_e *InterfaceWithResolvedAlias_Expecter) Foo() *InterfaceWithResolvedAlias_Foo_Call { + return &InterfaceWithResolvedAlias_Foo_Call{Call: _e.mock.On("Foo")} +} + +func (_c *InterfaceWithResolvedAlias_Foo_Call) Run(run func()) *InterfaceWithResolvedAlias_Foo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *InterfaceWithResolvedAlias_Foo_Call) Return(_a0 int) *InterfaceWithResolvedAlias_Foo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *InterfaceWithResolvedAlias_Foo_Call) RunAndReturn(run func() int) *InterfaceWithResolvedAlias_Foo_Call { + _c.Call.Return(run) + return _c +} + +// NewInterfaceWithResolvedAlias creates a new instance of InterfaceWithResolvedAlias. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewInterfaceWithResolvedAlias(t interface { + mock.TestingT + Cleanup(func()) +}) *InterfaceWithResolvedAlias { + mock := &InterfaceWithResolvedAlias{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/fixtures/type_alias/mock_InterfaceWithUnresolvedAlias_test.go b/pkg/fixtures/type_alias/mock_InterfaceWithUnresolvedAlias_test.go new file mode 100644 index 000000000..677b2dbe3 --- /dev/null +++ b/pkg/fixtures/type_alias/mock_InterfaceWithUnresolvedAlias_test.go @@ -0,0 +1,80 @@ +// Code generated by mockery. DO NOT EDIT. + +package type_alias_test + +import ( + mock "github.com/stretchr/testify/mock" + type_alias "github.com/vektra/mockery/v2/pkg/fixtures/type_alias" +) + +// InterfaceWithUnresolvedAlias is an autogenerated mock type for the Interface1 type +type InterfaceWithUnresolvedAlias struct { + mock.Mock +} + +type InterfaceWithUnresolvedAlias_Expecter struct { + mock *mock.Mock +} + +func (_m *InterfaceWithUnresolvedAlias) EXPECT() *InterfaceWithUnresolvedAlias_Expecter { + return &InterfaceWithUnresolvedAlias_Expecter{mock: &_m.Mock} +} + +// Foo provides a mock function with given fields: +func (_m *InterfaceWithUnresolvedAlias) Foo() type_alias.Type { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Foo") + } + + var r0 type_alias.Type + if rf, ok := ret.Get(0).(func() type_alias.Type); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(type_alias.Type) + } + + return r0 +} + +// InterfaceWithUnresolvedAlias_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' +type InterfaceWithUnresolvedAlias_Foo_Call struct { + *mock.Call +} + +// Foo is a helper method to define mock.On call +func (_e *InterfaceWithUnresolvedAlias_Expecter) Foo() *InterfaceWithUnresolvedAlias_Foo_Call { + return &InterfaceWithUnresolvedAlias_Foo_Call{Call: _e.mock.On("Foo")} +} + +func (_c *InterfaceWithUnresolvedAlias_Foo_Call) Run(run func()) *InterfaceWithUnresolvedAlias_Foo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *InterfaceWithUnresolvedAlias_Foo_Call) Return(_a0 type_alias.Type) *InterfaceWithUnresolvedAlias_Foo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *InterfaceWithUnresolvedAlias_Foo_Call) RunAndReturn(run func() type_alias.Type) *InterfaceWithUnresolvedAlias_Foo_Call { + _c.Call.Return(run) + return _c +} + +// NewInterfaceWithUnresolvedAlias creates a new instance of InterfaceWithUnresolvedAlias. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewInterfaceWithUnresolvedAlias(t interface { + mock.TestingT + Cleanup(func()) +}) *InterfaceWithUnresolvedAlias { + mock := &InterfaceWithUnresolvedAlias{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/generator.go b/pkg/generator.go index 42eb14a49..ae2ca81dd 100644 --- a/pkg/generator.go +++ b/pkg/generator.go @@ -65,6 +65,7 @@ type GeneratorConfig struct { UnrollVariadic bool WithExpecter bool ReplaceType []string + ResolveTypeAlias bool } // Generator is responsible for generating the string containing @@ -532,10 +533,24 @@ func (g *Generator) renderNamedType(ctx context.Context, t interface { } func (g *Generator) renderType(ctx context.Context, typ types.Type) string { + log := zerolog.Ctx(ctx) switch t := typ.(type) { case *types.Named: return g.renderNamedType(ctx, t) case *types.Alias: + log.Debug().Msg("found type alias") + if g.config.ResolveTypeAlias { + logging.WarnDeprecated( + ctx, + "resolve-type-alias will be permanently set to False in v3. Please modify your config to set the parameter to False.", + map[string]any{ + "url": logging.DocsURL("/deprecations/#resolve-type-alias"), + }, + ) + log.Debug().Msg("resolving type alias to underlying type") + return g.renderType(ctx, t.Underlying()) + } + log.Debug().Msg("not resolving type alias to underlying type") return g.renderNamedType(ctx, t) case *types.TypeParam: if t.Constraint() != nil { diff --git a/pkg/generator_test.go b/pkg/generator_test.go index 293ea2eb4..b742cba9f 100644 --- a/pkg/generator_test.go +++ b/pkg/generator_test.go @@ -168,7 +168,7 @@ func (s *GeneratorSuite) TestGeneratorExpecterComplete() { } func (s *GeneratorSuite) TestGeneratorExpecterWithRolledVariadic() { - expectedBytes, err := os.ReadFile(getMocksPath("ExpecterAndRolledVariadic.go")) + expectedBytes, err := os.ReadFile(getMocksPath("ExpecterAndRolledVariadic_mock.go")) s.Require().NoError(err) expected := string(expectedBytes) expected = expected[strings.Index(expected, "// ExpecterAndRolledVariadic is"):] @@ -194,7 +194,7 @@ func (s *GeneratorSuite) TestGeneratorExpecterWithRolledVariadic() { } func (s *GeneratorSuite) TestGeneratorVariadicNoReturn() { - expectedBytes, err := os.ReadFile(getMocksPath("VariadicNoReturnInterface.go")) + expectedBytes, err := os.ReadFile(getMocksPath("VariadicNoReturnInterface_mock.go")) s.Require().NoError(err) expected := string(expectedBytes) @@ -341,7 +341,7 @@ func (s *GeneratorSuite) TestGeneratorTreatsAnyAsNilable() { cfg := GeneratorConfig{ WithExpecter: true, } - expectedBytes, err := os.ReadFile(getMocksPath("UsesAny.go")) + expectedBytes, err := os.ReadFile(getMocksPath("UsesAny_mock.go")) s.Require().NoError(err) expected := string(expectedBytes) expected = expected[strings.Index(expected, "// UsesAny is"):] @@ -394,7 +394,7 @@ func (s *GeneratorSuite) TestGeneratorReturnElidedType() { } func (s *GeneratorSuite) TestGeneratorVariadicArgs() { - expectedBytes, err := os.ReadFile(getMocksPath("RequesterVariadic.go")) + expectedBytes, err := os.ReadFile(getMocksPath("RequesterVariadic_mock.go")) s.Require().NoError(err) expected := string(expectedBytes) expected = expected[strings.Index(expected, "// RequesterVariadic is"):] @@ -402,7 +402,7 @@ func (s *GeneratorSuite) TestGeneratorVariadicArgs() { } func (s *GeneratorSuite) TestGeneratorVariadicArgsAsOneArg() { - expectedBytes, err := os.ReadFile(getMocksPath("RequesterVariadicOneArgument.go")) + expectedBytes, err := os.ReadFile(getMocksPath("RequesterVariadicOneArgument_mock.go")) s.Require().NoError(err) expected := string(expectedBytes) expected = expected[strings.Index(expected, "// RequesterVariadicOneArgument is"):] diff --git a/pkg/outputter.go b/pkg/outputter.go index e3c4d978a..75df24f6a 100644 --- a/pkg/outputter.go +++ b/pkg/outputter.go @@ -342,8 +342,9 @@ func (m *Outputter) Generate(ctx context.Context, iface *Interface) error { UnrollVariadic: interfaceConfig.UnrollVariadic, WithExpecter: interfaceConfig.WithExpecter, ReplaceType: interfaceConfig.ReplaceType, + ResolveTypeAlias: interfaceConfig.ResolveTypeAlias, } - generator := NewGenerator(ctx, g, iface, "") + generator := NewGenerator(ctx, g, iface, interfaceConfig.Outpkg) log.Debug().Msg("generating mock in-memory") if err := generator.GenerateAll(ctx); err != nil { diff --git a/pkg/walker.go b/pkg/walker.go index 6d290efd4..75e1e67f2 100644 --- a/pkg/walker.go +++ b/pkg/walker.go @@ -128,6 +128,7 @@ type GeneratorVisitorConfig struct { UnrollVariadic bool WithExpecter bool ReplaceType []string + ResolveTypeAlias bool } type GeneratorVisitor struct { @@ -189,6 +190,7 @@ func (v *GeneratorVisitor) VisitWalk(ctx context.Context, iface *Interface) erro UnrollVariadic: v.config.UnrollVariadic, WithExpecter: v.config.WithExpecter, ReplaceType: v.config.ReplaceType, + ResolveTypeAlias: v.config.ResolveTypeAlias, } gen := NewGenerator(ctx, generatorConfig, iface, "")