Skip to content

Commit

Permalink
Use mockgen version from go.mod instead of from "make bootstrap"
Browse files Browse the repository at this point in the history
Even though the Makefile wants to encourage using [email protected], 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
  • Loading branch information
dweitzman committed May 27, 2020
1 parent 0dd5b8b commit 902ff51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ VERSION ?= $(GIT_REF)
SHELL := /bin/bash

.PHONY: bootstrap
bootstrap:
go get github.com/golang/mock/[email protected]
bootstrap: ;

define REDIS_STUNNEL
cert = private.pem
Expand Down
8 changes: 4 additions & 4 deletions test/mocks/mocks.go
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 902ff51

Please sign in to comment.