Skip to content

Commit f1ce945

Browse files
committed
mockery v3
1 parent a539f49 commit f1ce945

File tree

9 files changed

+114
-85
lines changed

9 files changed

+114
-85
lines changed

.mockery.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.mockery.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
all: false
2+
dir: '{{.InterfaceDir}}'
3+
filename: mocks_test.go
4+
force-file-write: true
5+
formatter: goimports
6+
log-level: info
7+
structname: '{{.Mock}}{{.InterfaceName}}'
8+
pkgname: '{{.SrcPackageName}}'
9+
recursive: false
10+
require-template-schema-exists: true
11+
template: testify
12+
template-schema: '{{.Template}}.schema.json'
13+
packages:
14+
github.com/moukoublen/goboilerplate:
15+
config:
16+
all: true
17+
recursive: true

.vscode/cspell.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"gojq",
1919
"golangci",
2020
"gomod",
21-
"GOPATH",
2221
"GOVERSION",
2322
"honnef",
2423
"httpcompress",

internal/zhttp/mock_http_client_test.go renamed to internal/zhttp/mocks_test.go

Lines changed: 37 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/go.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ GO_FILES = find . -type f -name '*.go' -not -path './vendor/*'
66

77
export GO111MODULE := on
88
#export GOFLAGS := -mod=vendor
9-
GOPATH := $(shell go env GOPATH)
10-
GO_VER := $(shell go env GOVERSION)
119
BUILD_OUTPUT ?= $(CURDIR)/output
1210

1311

scripts/tools.mk

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
## NOTINTERMEDIATE requires make >=4.4
66
.NOTINTERMEDIATE:
77

8+
GO_VER := $(shell go env GOVERSION)
9+
810
# https://www.gnu.org/software/make/manual/make.html#Automatic-Variables
911
# https://www.gnu.org/software/make/manual/make.html#Prerequisite-Types
1012

@@ -14,6 +16,9 @@ TOOLS_BIN ?= $(TOOLS_DIR)/bin
1416
export TOOLS_BIN
1517
export PATH := $(TOOLS_BIN):$(PATH)
1618

19+
.PHONY: checks
20+
checks: vet gofumpt goimports golangci-lint
21+
1722
.PHONY: tools
1823
tools: \
1924
$(TOOLS_BIN)/goimports \
@@ -158,35 +163,17 @@ air: $(TOOLS_BIN)/air
158163

159164
## <mockery>
160165
# https://github.com/vektra/mockery/releases
161-
MOCKERY_MOD:=github.com/vektra/mockery/v2
166+
MOCKERY_MOD:=github.com/vektra/mockery/v3
162167
MOCKERY_VER:=$(call go_mod_ver,$(MOCKERY_MOD))
163168
$(TOOLS_BIN)/mockery: $(TOOLS_DB)/mockery.$(MOCKERY_VER).$(GO_VER).ver
164169
$(call go_install,mockery,$(MOCKERY_MOD),$(MOCKERY_VER))
165170

166171
.PHONY: mockery
167172
mockery: $(TOOLS_BIN)/mockery
168173
grep --recursive --files-with-matches '// Code generated by mockery' . | grep -v 'scripts/tools.mk' | grep -v 'bin/mockery' | xargs rm || true
169-
mockery --config ./.mockery.yaml
174+
mockery --config ./.mockery.yml
170175
## </mockery>
171176

172-
## <protobuf>
173-
# https://github.com/protocolbuffers/protobuf/releases
174-
PROTOC_VER:=v29.2
175-
$(TOOLS_BIN)/protoc: $(TOOLS_DB)/protoc.$(PROTOC_VER).ver
176-
./scripts/install-protoc --version $(PROTOC_VER) --destination $(TOOLS_DIR)
177-
178-
# https://github.com/protocolbuffers/protobuf-go/releases
179-
PROTOC-GEN-GO_CMD:=google.golang.org/protobuf/cmd/protoc-gen-go
180-
PROTOC-GEN-GO_VER:=v1.36.1
181-
$(TOOLS_BIN)/protoc-gen-go: $(TOOLS_DB)/protoc-gen-go.$(PROTOC-GEN-GO_VER).$(GO_VER).ver
182-
$(call go_install,protoc-gen-go,$(PROTOC-GEN-GO_CMD),$(PROTOC-GEN-GO_VER))
183-
184-
.PHONY: proto
185-
proto: $(TOOLS_BIN)/protoc $(TOOLS_BIN)/protoc-gen-go
186-
$(TOOLS_BIN)/protoc --version
187-
$(TOOLS_BIN)/protoc-gen-go --version
188-
## </protobuf>
189-
190177
## <shfmt>
191178
# https://github.com/mvdan/sh/releases
192179
SHFMT_MOD:=mvdan.cc/sh/v3

tools/go.mod

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/air-verse/air v1.62.0
1010
github.com/golangci/golangci-lint/v2 v2.1.6
1111
github.com/itchyny/gojq v0.12.17
12-
github.com/vektra/mockery/v2 v2.53.4
12+
github.com/vektra/mockery/v3 v3.3.2
1313
golang.org/x/tools v0.33.0
1414
honnef.co/go/tools v0.6.1
1515
mvdan.cc/gofumpt v0.8.0
@@ -47,6 +47,7 @@ require (
4747
github.com/bombsimon/wsl/v4 v4.7.0 // indirect
4848
github.com/breml/bidichk v0.3.3 // indirect
4949
github.com/breml/errchkjson v0.4.1 // indirect
50+
github.com/brunoga/deep v1.2.4 // indirect
5051
github.com/butuzov/ireturn v0.4.0 // indirect
5152
github.com/butuzov/mirror v1.3.0 // indirect
5253
github.com/catenacyber/perfsprint v0.9.1 // indirect
@@ -70,6 +71,7 @@ require (
7071
github.com/dlclark/regexp2 v1.11.5 // indirect
7172
github.com/ettle/strcase v0.2.0 // indirect
7273
github.com/fatih/color v1.18.0 // indirect
74+
github.com/fatih/structs v1.1.0 // indirect
7375
github.com/fatih/structtag v1.2.0 // indirect
7476
github.com/firefart/nonamedreturns v1.0.6 // indirect
7577
github.com/fsnotify/fsnotify v1.9.0 // indirect
@@ -108,18 +110,24 @@ require (
108110
github.com/hashicorp/go-version v1.7.0 // indirect
109111
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
110112
github.com/hexops/gotextdiff v1.0.3 // indirect
111-
github.com/huandu/xstrings v1.4.0 // indirect
112-
github.com/iancoleman/strcase v0.3.0 // indirect
113+
github.com/huandu/xstrings v1.5.0 // indirect
113114
github.com/inconshreveable/mousetrap v1.1.0 // indirect
114115
github.com/itchyny/timefmt-go v0.1.6 // indirect
116+
github.com/jedib0t/go-pretty/v6 v6.6.7 // indirect
115117
github.com/jgautheron/goconst v1.8.1 // indirect
116118
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
117-
github.com/jinzhu/copier v0.4.0 // indirect
118119
github.com/jjti/go-spancheck v0.6.4 // indirect
119120
github.com/julz/importas v0.2.0 // indirect
120121
github.com/karamaru-alpha/copyloopvar v1.2.1 // indirect
121122
github.com/kisielk/errcheck v1.9.0 // indirect
122123
github.com/kkHAIKE/contextcheck v1.1.6 // indirect
124+
github.com/knadh/koanf/maps v0.1.1 // indirect
125+
github.com/knadh/koanf/parsers/yaml v0.1.0 // indirect
126+
github.com/knadh/koanf/providers/env v1.0.0 // indirect
127+
github.com/knadh/koanf/providers/file v1.1.2 // indirect
128+
github.com/knadh/koanf/providers/posflag v0.1.0 // indirect
129+
github.com/knadh/koanf/providers/structs v0.1.0 // indirect
130+
github.com/knadh/koanf/v2 v2.1.2 // indirect
123131
github.com/kulti/thelper v0.6.3 // indirect
124132
github.com/kunwardeep/paralleltest v1.0.14 // indirect
125133
github.com/lasiar/canonicalheader v1.1.2 // indirect
@@ -140,8 +148,9 @@ require (
140148
github.com/mattn/go-runewidth v0.0.16 // indirect
141149
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
142150
github.com/mgechev/revive v1.9.0 // indirect
151+
github.com/mitchellh/copystructure v1.2.0 // indirect
143152
github.com/mitchellh/go-homedir v1.1.0 // indirect
144-
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
153+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
145154
github.com/moricho/tparallel v0.3.2 // indirect
146155
github.com/muesli/termenv v0.16.0 // indirect
147156
github.com/nakabonne/nestif v0.3.1 // indirect
@@ -200,6 +209,9 @@ require (
200209
github.com/ultraware/whitespace v0.2.0 // indirect
201210
github.com/uudashr/gocognit v1.2.0 // indirect
202211
github.com/uudashr/iface v1.3.1 // indirect
212+
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
213+
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
214+
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
203215
github.com/xen0n/gosmopolitan v1.3.0 // indirect
204216
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
205217
github.com/yagipy/maintidx v1.0.0 // indirect
@@ -213,6 +225,7 @@ require (
213225
go.uber.org/automaxprocs v1.6.0 // indirect
214226
go.uber.org/multierr v1.11.0 // indirect
215227
go.uber.org/zap v1.24.0 // indirect
228+
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b // indirect
216229
golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect
217230
golang.org/x/mod v0.24.0 // indirect
218231
golang.org/x/sync v0.14.0 // indirect

0 commit comments

Comments
 (0)