Automatically generate Go test boilerplate from your source code.
5.3k
Stars
351
Forks
39
Open issues
23
Contributors
AI Analysis
gotests is a Go test generator that automatically creates table-driven test boilerplate from function signatures, with support for generics, custom templates, and recursive directory processing. It's specifically built for Go developers who want to accelerate test scaffolding; not useful for other languages or non-test contexts.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
gotests auto-generates Go table-driven test boilerplate from function signatures
gotests is a CLI tool and library that parses Go source files and generates idiomatic table-driven test scaffolding, including proper type handling, auto-imports, and subtest support. It targets Go developers who want to reduce repetitive test boilerplate while maintaining standard Go testing conventions. It is integrated into major Go editor plugins (VS Code via vscode-go, GoLand, Vim, Emacs, Sublime Text), which likely accounts for most of its real-world usage. A recent addition of local LLM-based test case generation via Ollama adds a differentiated capability beyond pure scaffolding.
Created in January 2016, gotests was an early attempt to bring code-generation ergonomics to Go testing. It predates many modern Go tooling improvements and established itself before editor integrations made test scaffolding a standard IDE feature.
Growth appears largely driven by integration into widely-used Go editor plugins, particularly the official vscode-go extension. This gave gotests passive distribution across a large portion of the Go developer base without requiring direct discovery. Star accumulation has slowed to near-zero (2 stars/week as of mid-2026), suggesting the tool is in a mature, stable phase rather than a growth phase.
Integration into vscode-go (the official VS Code Go extension) and JetBrains GoLand provides strong indirect evidence of widespread passive usage across the Go developer community. Direct production adoption metrics are not published, but editor plugin integration at this level is a credible proxy for substantial real-world use. Adoption not independently verified through download counts or organizational case studies.
Likely operates as a two-phase tool: AST parsing of Go source files to extract function/method signatures and types, followed by template rendering (text/template based, based on README references to custom templates) to produce test file output. The library and CLI appear separated, enabling editor plugin integration via the library API. Generics support was added, suggesting ongoing AST handling updates.
CI badges for Coveralls and Codecov are present in the README, indicating test coverage is measured and publicly tracked. Specific percentage not stated in README excerpt.
Last push was October 30, 2025 — approximately 8 months before the evaluation date of June 2026. This is a moderate gap but not alarming for a mature, feature-complete utility. GitHub Actions CI is configured. The README references Go 1.22 minimum and Go 1.18+ generics support, indicating reasonably current maintenance. The project is not under rapid development but shows no signs of abandonment.
ADOPT IF: you work in Go and want fast, consistent table-driven test scaffolding without writing boilerplate by hand, especially if using VS Code or GoLand where it integrates transparently. AVOID IF: your team already relies on AI coding assistants that generate test code contextually, or if you need tests with substantial domain logic seeded automatically rather than structural scaffolding. MONITOR IF: you are evaluating the Ollama-based AI test case generation feature — it is new and its reliability across codebases is not yet established.
Independent dimensions
Mainstream potential
4/10
Technical importance
6/10
Adoption evidence
5/10
- AI coding assistants (Copilot, Cursor, Gemini Code Assist) increasingly generate test scaffolding inline, potentially making a dedicated scaffolding CLI feel redundant for teams already using those tools.
- The 8-month gap since last push, while not alarming, combined with near-zero star growth suggests the project may be in feature-complete maintenance mode with limited bandwidth for major improvements.
- The new Ollama-based AI feature introduces an external runtime dependency (local LLM server) that adds operational complexity and has not had time to accumulate real-world reliability evidence.
- Go language evolution (new type features, testing stdlib additions) requires ongoing AST parsing updates; a slowdown in maintenance could cause compatibility gaps with future Go versions.
- No evidence of a dedicated maintainer organization or corporate sponsor, making long-term sustainability dependent on individual contributor availability.
gotests is likely to remain a stable, useful utility in the Go ecosystem primarily through editor plugin integration. It is unlikely to see significant growth but also unlikely to become obsolete in the near term given its embedded role in vscode-go and GoLand.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- Go
- License
- Apache-2.0
- Last updated
- 8mo ago
- Created
- 128mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
E2E tests: qwen2.5-coder:0.5b non-determinism with receiver method instantiation
const vaues getting parsed
add custom template
Having a config file for each project
Support only 2 latest major go releases
Top contributors
Similar repos
go-testfixtures/testfixtures
testfixtures provides a Go library for writing functional database tests using...
maxbrunsfeld/counterfeiter
Counterfeiter is a Go code generation tool that automatically produces...
quii/learn-go-with-tests
Learn Go with Tests is a comprehensive, free educational resource that teaches...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
5.3k | +9 | Go | 8/10 | 8mo ago |
|
|
1.2k | — | Go | 8/10 | 7d ago |
|
|
1.1k | — | Go | 8/10 | 2w ago |
|
|
38.8k | — | C++ | 9/10 | 3d ago |
|
|
23.7k | — | Go | 8/10 | 2mo ago |
|
|
7.2k | — | Go | 8/10 | 3w ago |
vscode-go's 'Generate unit tests for function/file/package' command is directly powered by gotests under the hood, making them complementary rather than competing. gotests is the engine; the IDE command is the interface.
testify provides test assertion utilities and suite structures but does not generate test scaffolding from source code. gotests explicitly supports testify templates, positioning them as complementary tools.
mockery generates mock implementations from interfaces, while gotests generates test function scaffolding from any function signature. Different generation targets; both tools can be used together in the same project.
Modern AI coding assistants can generate test code inline and may reduce the unique value proposition of gotests for developers already using them. gotests's new Ollama integration is a direct response to this pressure, but AI assistants offer broader context awareness.
gotestsum and related tools focus on test execution and reporting, not generation. No functional overlap with gotests.
