cweill

cweill/gotests

Go Apache-2.0 Dev Tools

Automatically generate Go test boilerplate from your source code.

5.3k stars
351 forks
slow
GitHub +9 / week

5.3k

Stars

351

Forks

39

Open issues

23

Contributors

v1.9.0 28 Oct 2025

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.

Dev Tools Developer Tool Discovery value: 4/10
Documentation 9/10
Activity 7/10
Community 8/10
Code quality 8/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

test-generation go-tooling code-automation table-driven-tests static-analysis
Actively maintained Well documented Popular Niche/specialized use case Beginner friendly Production ready
Deep Analysis · Based on README and public signals
2w ago

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.

Origin

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

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.

In production

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.

Code analysis
Architecture

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.

Tests

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.

Maintenance

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.

Honest verdict

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

Risks
  • 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.
Prediction

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.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

Go
99.1%
Shell
0.9%

Information

Language
Go
License
Apache-2.0
Last updated
8mo ago
Created
128mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

go-testfixtures

go-testfixtures/testfixtures

testfixtures provides a Go library for writing functional database tests using...

1.2k Go Dev Tools
maxbrunsfeld

maxbrunsfeld/counterfeiter

Counterfeiter is a Go code generation tool that automatically produces...

1.1k Go Dev Tools
google

google/googletest

GoogleTest is Google's C++ testing framework combining the formerly separate...

38.8k C++ Dev Tools
quii

quii/learn-go-with-tests

Learn Go with Tests is a comprehensive, free educational resource that teaches...

23.7k Go Education
vektra

vektra/mockery

mockery is a code generator that automatically creates mock implementations for...

7.2k Go Dev Tools
vs. alternatives
vscode-go built-in generate tests

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 (testify/suite)

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 (vektra/mockery)

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.

AI coding assistants (Copilot, Cursor, etc.)

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 / go test tooling

gotestsum and related tools focus on test execution and reporting, not generation. No functional overlap with gotests.