Skip to content

Commit

Permalink
README: add usage with go:generate comment
Browse files Browse the repository at this point in the history
  • Loading branch information
utgwkk committed Jul 8, 2023
1 parent 2d04186 commit 45b535c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 45b535c

Please sign in to comment.