Skip to content
Back to skills

Golang Testing

ASecurity

Write and fix tests in Go: write table-driven tests with t.Run subtests, mocking at boundaries, async tests and CI settings.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsgotesting

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add karthikrshet/saarthi --skill golang-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Golang Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Golang Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/karthikrshet-golang-testing/badge)](https://www.skillsdirectory.com/skills/karthikrshet-golang-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: golang-testing
description: "Write and fix tests in Go: write table-driven tests with t.Run subtests, mocking at boundaries, async tests and CI settings."
tags: [golang, testing]
---

# Golang Testing

## When to use

- Writing or reviewing Go tests
- Setting up a test suite
- Fixing slow or flaky tests

## Procedure

1. Write table-driven tests with t.Run subtests
2. Use t.Helper in helpers and t.Cleanup for teardown
3. Use httptest for handlers and fakes for interfaces
4. Run with -race and -count=1 in CI
5. Add fuzz tests (go test -fuzz) for parsers

## Checklist

- [ ] Race detector clean
- [ ] Golden files updated deliberately

## Anti-patterns

- Sleeping to wait for goroutines
- Testing unexported internals from another package

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.