Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. gotests

gotests

Apache-2.0Gov1.9.0

Automatically generates table-driven Go test boilerplate from source code, with optional AI-powered test case generation.

GitHubGitHub
5.3k stars352 forks0 contributors

What is gotests?

gotests is a command-line tool that automatically generates table-driven test scaffolding for Go code. It analyzes function and method signatures to create comprehensive test structures, saving developers time by automating repetitive boilerplate and ensuring consistency across test suites.

Target Audience

Go developers and teams who want to improve test coverage and maintainability by automating the creation of table-driven test scaffolding, particularly those working on projects with many functions or complex logic.

Value Proposition

Developers choose gotests for its zero-configuration setup, full support for Go generics, and the unique AI-powered test generation feature that uses local LLMs via Ollama to create intelligent test cases with realistic values and edge cases.

Overview

Automatically generate Go test boilerplate from your source code.

Use Cases

Best For

  • Automatically generating table-driven test scaffolding for Go functions and methods to save time on boilerplate.
  • Creating consistent test structures across large Go codebases to maintain code quality.
  • Generating tests for Go 1.18+ generic functions and methods with proper type handling.
  • Using AI to generate intelligent test cases with realistic values and edge cases via local LLMs (Ollama).
  • Integrating test generation into editors like VS Code, IntelliJ Goland, Vim, or Emacs via plugins.
  • Applying custom test templates, such as for the testify assertion library, to match project standards.

Not Ideal For

  • Teams using behavior-driven development (BDD) frameworks like Ginkgo that don't align with table-driven test patterns.
  • Projects with sensitive code where AI analysis of function bodies poses privacy risks, even with local LLMs.
  • Small scripts or one-off functions where the overhead of setting up and using the tool outweighs the time saved.

Pros & Cons

Pros

Zero-Configuration Operation

Works out of the box with any Go project without needing setup files, as stated in the README's key features for quick adoption.

Full Generics Support

Handles Go 1.18+ type parameters seamlessly, generating appropriate test code for generic functions with intelligent type constraint mapping, as detailed in the Go Generics Support section.

AI-Powered Test Generation

Uses local LLMs via Ollama to create intelligent test cases with realistic values and edge cases, automating meaningful test logic beyond basic scaffolding, as demonstrated in the AI examples.

Flexible Filtering Options

Allows precise test generation for specific functions, exported functions, or entire packages using regex patterns and flags like -only and -excl, shown in the usage examples.

Cons

AI Dependency Complexity

Requires installing and managing Ollama with models for AI features, adding setup steps and dependency on external tools beyond basic Go tooling.

Privacy Risks with AI

Function bodies, including sensitive code and comments, are sent to the LLM for analysis, posing risks for proprietary projects, as warned in the privacy considerations section.

Limited Test Pattern Support

Only generates table-driven test structures, which may not suit projects preferring alternative testing styles like BDD or mock-heavy frameworks.

Frequently Asked Questions

Quick Stats

Stars5,329
Forks352
Contributors0
Open Issues33
Last commit10 months ago
CreatedSince 2016

Tags

#golang-application#developer-tools#ai-testing#testify#go-generics#code-generator#boilerplate#test-generation#testing#ollama#golang#testing-tools#go#golang-tools#test-driven-development

Built With

G
Go

Included in

Go169.1k
Auto-fetched 7 hours ago

Related Projects

xgenxgen

XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator

Stars424
Forks105
Last commit6 days ago
hasgohasgo

Haskell-flavoured functions for Go :smiley:

Stars144
Forks11
Last commit5 years ago
gocontractsgocontracts

A tool for design-by-contract in Go

Stars118
Forks12
Last commit7 years ago
options-genoptions-gen

Codegen for functional options in go projects

Stars112
Forks13
Last commit2 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub