From 45b535c8569b022ee51e9a819daf39ab2230e1cc Mon Sep 17 00:00:00 2001 From: utgwkk Date: Sat, 8 Jul 2023 19:21:45 +0900 Subject: [PATCH] README: add usage with go:generate comment --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index d443bd2..789c2f3 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,19 @@ package fixtures //go:generate go run go.uber.org/mock/mockgen -destination mock_foo/mock_foo.go -package mock_foo . IFoo,IBar ``` +You can also use mockgengen with `//go:generate` comment. + +```go +package foo + +//go:generate go run github.com/utgwkk/mockgengen/cmd/mockgengen -package mock_foo -out ./mockgen.go . Iset + +var Iset = []any{ + new(IFoo), + new(IBar), +} +``` + ## Restriction - Mockgengen is available for gomock's reflect mode. Source mode is currently not available.