Agent skill

go-testing

Go testing patterns. Routes to specific patterns.

Stars 3
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/JamesPrial/claudefiles/tree/main/skills/golang/testing

SKILL.md

Testing

Route by Pattern

  • Table-driven tests → see table/
  • Subtests with t.Run → see subtests/
  • Test helpers → see helpers/
  • Benchmarks → see benchmarks/

Quick Check

  • Tests named Test_Function_Scenario
  • Table tests for >2 cases
  • Helpers call t.Helper()
  • Parallel tests capture loop vars

Common Patterns

Basic test structure:

go
func Test_Function_Scenario(t *testing.T) {
    // Arrange
    input := "test"

    // Act
    result := Function(input)

    // Assert
    if result != expected {
        t.Errorf("got %v, want %v", result, expected)
    }
}

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results