impgen

command
v0.0.0-...-3621051 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址