From 20d594bda27dd157fc96e6515dcacd7c7bd057e4 Mon Sep 17 00:00:00 2001 From: David Weitzman Date: Tue, 26 May 2020 17:17:41 -0700 Subject: [PATCH] Use mockgen version from go.mod instead of from "make bootstrap" Even though the Makefile wants to encourage using mockgen@1.4.1, it seems like the mocks have been generated using a pre-1.0 version of mockgen. Using "go run github.com/golang/mock/mockgen" as a go:generate command instead of just "mockgen" avoids the need to pre-install into the developer's $PATH and uses the go.mod-specified version Signed-off-by: David Weitzman --- Makefile | 3 +-- test/mocks/mocks.go | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 553f6d5e..038300a2 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,7 @@ VERSION ?= $(GIT_REF) SHELL := /bin/bash .PHONY: bootstrap -bootstrap: - go get github.com/golang/mock/mockgen@v1.4.1 +bootstrap: ; define REDIS_STUNNEL cert = private.pem diff --git a/test/mocks/mocks.go b/test/mocks/mocks.go index efe80f84..e0ce8288 100644 --- a/test/mocks/mocks.go +++ b/test/mocks/mocks.go @@ -1,6 +1,6 @@ package mocks -//go:generate mockgen -destination ./runtime/snapshot/snapshot.go github.com/lyft/goruntime/snapshot IFace -//go:generate mockgen -destination ./runtime/loader/loader.go github.com/lyft/goruntime/loader IFace -//go:generate mockgen -destination ./config/config.go github.com/envoyproxy/ratelimit/src/config RateLimitConfig,RateLimitConfigLoader -//go:generate mockgen -destination ./redis/redis.go github.com/envoyproxy/ratelimit/src/redis RateLimitCache,Pool,Connection,Response,TimeSource,JitterRandSource +//go:generate go run github.com/golang/mock/mockgen -destination ./runtime/snapshot/snapshot.go github.com/lyft/goruntime/snapshot IFace +//go:generate go run github.com/golang/mock/mockgen -destination ./runtime/loader/loader.go github.com/lyft/goruntime/loader IFace +//go:generate go run github.com/golang/mock/mockgen -destination ./config/config.go github.com/envoyproxy/ratelimit/src/config RateLimitConfig,RateLimitConfigLoader +//go:generate go run github.com/golang/mock/mockgen -destination ./redis/redis.go github.com/envoyproxy/ratelimit/src/redis RateLimitCache,Pool,Connection,Response,TimeSource,JitterRandSource