/go-service-guide:testingfrom go-service-guide
Provides Go testing patterns including table-driven tests, mock setup with gomock, and coverage requirements. Use when writing tests or setting up test infrastructure.
Ships in go-service-guide. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
References: Examples
| Rule | Value |
|---|---|
| Unit tests | TestFunctionName |
| Integration tests | TestIntegration* |
| Coverage | 85% minimum |
| Tools | testify/assert, gomock |
Add at top of file with interfaces:
//go:generate mockgen -source=service.go -destination=service_mock.go -package=<pkg>
Run with:
make generate
Use for testing multiple scenarios:
func TestFunction(t *testing.T) {
tests := []struct {
name string
input string
expected string
wantErr bool
}{
{name: "valid input", input: "foo", expected: "bar"},
{name: "empty input", input: "", wantErr: true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// test logic
})
}
}
func TestService(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockRepo := mocks.NewMockRepository(ctrl)
mockRepo.EXPECT().
FindByID(gomock.Any(), "id").
Return(&Entity{}, nil)
svc := NewService(mockRepo)
// test...
}
Use testify/assert:
assert.NoError(t, err)
assert.Equal(t, expected, actual)
assert.Nil(t, result)
assert.NotNil(t, result)
assert.True(t, condition)
assert.Contains(t, slice, element)
What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/architectureClean/hexagonal architecture rules, folder structure, interface ownership, and dependency direction. Use when creating new packages, services, or understanding codebase structure./concurrencyGoroutine ownership, errgroup patterns, worker pools, and graceful shutdown. Use when writing concurrent code or parallel request handling./go-styleUber Go style guide rules for guidelines, performance, and code style. Use when writing or reviewing Go code for style compliance./observabilityTracing with OpenTelemetry and structured logging with slog. Use when adding observability to services, handlers, or debugging production issues./patternsProject patterns including functional options, must pattern, caching decorator, error handling, configuration, and HTTP clients. Use when implementing common patterns in the codebase.npx claudepluginhub cemezgin/go-service-guide --plugin go-service-guideOther plugins' skills for the same job