gotests is a code generator that automatically creates table-driven tests from Go source code.
The tool solves the problem of test boilerplate by analyzing function and method signatures to generate comprehensive test scaffolding. It works by parsing your Go code and producing complete test structures with proper type handling, automatically adding required imports and supporting Go generics. The tool can target specific functions, exported functions only, or entire packages, and can process directory trees recursively.
Developers should choose this tool if they want to reduce the manual effort of writing test stubs and ensure consistency across their test suite. It suits any Go project and works out of the box without configuration. The tool integrates with multiple editors including Visual Studio Code, Vim, Emacs, Sublime Text, Atom, and IntelliJ Goland through existing plugins. For teams wanting more sophisticated test case generation, the tool includes optional AI-powered test generation via local LLMs through Ollama, which can generate realistic test values, edge cases, and error conditions by analyzing function implementations.
The project maintains active development with regular updates and comprehensive test coverage. The codebase demonstrates consistent attention to quality through automated testing and code analysis. The tool supports modern Go features including type parameters from Go 1.18 onward and requires Go 1.22 as a minimum version.