go

Enforce Go coding standards and table-driven testing patterns.

16|1|Updated Jun 26, 2025
One-click install
npx skills add https://github.com/bendrucker/claude --skill go-bendrucker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go
Source: https://github.com/bendrucker/claude/tree/main/.claude/skills/go
Command: npx skills add https://github.com/bendrucker/claude --skill go-bendrucker

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures Go code consistency and quality by providing immediate access to best practices, reducing review cycles and errors.

Core Features & Use Cases

  • Coding Standards: Adhere to the latest Go language features and project-specific go.mod versions.
  • Testing Patterns: Implement robust, readable table-style tests with clear naming conventions.
  • Use Case: When writing a new Go module, this Skill guides you to write idiomatic, well-tested code from the start, saving time on refactoring and debugging.

Quick Start

func TestMyFunction(t *testing.T) { for _, tc := range []struct { name string input string expected string }{ { name: "case1", input: "input1", expected: "expected1", }, } { t.Run(tc.name, func(t *testing.T) { if result := MyFunction(tc.input); result != tc.expected { t.Errorf("expected %s, got %s", tc.expected, result) } }) } }

Frequently Asked Questions about go

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write table-driven tests in Go?

Table-driven tests in Go use a struct slice with test cases, each containing a name field and input/expected values. Iterate through cases with t.Run() to execute subtests, improving readability and maintainability compared to sequential test functions.

What are Go coding standards and best practices?

Go coding standards emphasize idiomatic code, consistent naming, proper error handling, and adherence to language features specified in go.mod. Following these practices reduces review cycles, improves code quality, and ensures consistency across Go codebases.

How do I enforce Go best practices across a codebase?

Apply consistent Go coding standards and testing patterns during code review by checking for idiomatic conventions, table-driven tests with named cases, and compliance with project version constraints from go.mod.

Do test case names affect test behavior in Go?

No, test case names in table-driven tests serve documentation purposes only and do not influence test execution or results. Names should use space-delimited words for clarity without affecting the test logic itself.

What role does go.mod play in Go coding standards?

go.mod specifies Go version and dependency constraints for your project. Code must adhere to the declared Go version's language features and maintain compatibility with locked dependency versions to ensure consistent builds.