Documentation
¶
Overview ¶
imptest/impgen is a tool to generate test mocks for Go interfaces. To use it, install it with `go install github.com/toejough/imptest/impgen@latest` and in your test files, add a `//go:generate impgen <interface>` comment to generate a mock for the specified interface. By default, the mocked struct will be named <interface>Imp. Add a `--name <mockname>` flag to specify a custom name for the generated mock struct. The generated mock will be placed in a file named <mockname>_test.go, in the same package as the test file containing the `//go:generate` comment.
Click to show internal directories.
Click to hide internal directories.