Skip to content

Commit be99981

Browse files
committed
Move mockgen to a go.mod managed tool
1 parent 1015d90 commit be99981

File tree

10 files changed

+12
-11
lines changed

10 files changed

+12
-11
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ tools: $(GOBIN) tools-golangci-lint ## Install useful tools for linting, docs ge
250250
@ cd tools && go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
251251
@ cd tools && go install github.com/goreleaser/goreleaser/v2
252252
@ cd tools && go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen
253-
@ cd tools && go install go.uber.org/mock/mockgen
254253

255254
.PHONY: tools-golangci-lint
256255
tools-golangci-lint: ## Download golangci-lint locally if necessary.

generated/alerting/api_alerting_mocks.go

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

generated/alerting/mocks.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package alerting
2+
3+
//go:generate go tool go.uber.org/mock/mockgen -destination=./api_alerting_mocks.go -package=alerting -source ./api_alerting.go AlertingAPI

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,5 @@ require (
8888
)
8989

9090
replace github.com/disaster37/go-kibana-rest/v8 => ./libs/go-kibana-rest
91+
92+
tool go.uber.org/mock/mockgen

internal/clients/kibana/alerting.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ func ruleActionsToActionsInner(ruleActions []models.AlertingRuleAction) []alerti
150150
return actions
151151
}
152152

153+
//go:generate go tool go.uber.org/mock/mockgen -destination=./alerting_mocks.go -package=kibana -source ./alerting.go ApiClient
153154
type ApiClient interface {
154155
GetAlertingClient() (alerting.AlertingAPI, error)
155156
SetAlertingAuthContext(context.Context) context.Context

internal/clients/kibana/alerting_mocks.go

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

tools/connectors_gen.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -package connectors -o ../generated/connectors/connectors.gen.go -generate "types,client" ../generated/connectors/bundled.yaml
2-
//go:generate go run go.uber.org/mock/mockgen -destination=../generated/alerting/api_alerting_mocks.go -package=alerting -source ../generated/alerting/api_alerting.go AlertingAPI
3-
//go:generate go run go.uber.org/mock/mockgen -destination=../internal/clients/kibana/alerting_mocks.go -package=kibana -source ../internal/clients/kibana/alerting.go ApiClient
42

53
package tools

tools/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ require (
99
github.com/goreleaser/goreleaser/v2 v2.10.2
1010
github.com/hashicorp/terraform-plugin-docs v0.21.0
1111
github.com/oapi-codegen/oapi-codegen/v2 v2.4.1
12-
go.uber.org/mock v0.5.2
1312
gopkg.in/yaml.v3 v3.0.1
1413
)
1514

tools/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,8 +1057,6 @@ go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwE
10571057
go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
10581058
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
10591059
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
1060-
go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
1061-
go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
10621060
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
10631061
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
10641062
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=

tools/tools.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ import (
88
_ "github.com/goreleaser/goreleaser/v2"
99
_ "github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs"
1010
_ "github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen"
11-
_ "go.uber.org/mock/mockgen"
1211
_ "gopkg.in/yaml.v3"
1312
)

0 commit comments

Comments
 (0)