From 0709f8c472f4ff7b79b77a241654907603718b54 Mon Sep 17 00:00:00 2001 From: Wojtek Date: Wed, 12 Jun 2024 09:08:45 +0200 Subject: [PATCH] Install `mockgen` --- build/tools/tools.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build/tools/tools.go b/build/tools/tools.go index 1524ead1..94620b69 100644 --- a/build/tools/tools.go +++ b/build/tools/tools.go @@ -39,6 +39,7 @@ const ( Osmosis Name = "osmosis" Hermes Name = "hermes" CoredV303 Name = "cored-v3.0.3" + Mockgen = "mockgen" Buf Name = "buf" Protoc Name = "protoc" ProtocGenDoc Name = "protoc-gen-doc" @@ -390,6 +391,13 @@ var tools = []Tool{ Package: "github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking", }, + // https://github.com/uber-go/mock/releases + GoPackageTool{ + Name: Mockgen, + Version: "v0.4.0", + Package: "go.uber.org/mock/mockgen", + }, + // https://rust-lang.github.io/rustup/installation/other.html BinaryTool{ Name: RustUpInit, @@ -1077,6 +1085,11 @@ func EnsureProtocGenBufBreaking(ctx context.Context, deps types.DepsFunc) error return Ensure(ctx, ProtocGenBufBreaking, TargetPlatformLocal) } +// EnsureMockgen ensures that mockgen is available. +func EnsureMockgen(ctx context.Context, deps types.DepsFunc) error { + return Ensure(ctx, Mockgen, TargetPlatformLocal) +} + func linkTool(tool Tool, platform TargetPlatform, binaries ...string) error { for _, dst := range binaries { relink, err := shouldRelink(tool, platform, dst)