Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
testdino-hq avatar

Go

  • 2 installs
  • 8 repo stars
  • Updated February 25, 2026
  • testdino-hq/google-styleguides-skills

Applies Google's official Go style guide for formatting, naming, error handling, and idiomatic package organization.

About

Google's official Go style guide covering gofmt formatting, naming, error handling, interfaces, and concurrency. A developer uses it to write and review idiomatic, maintainable Go code.

  • Google's official Go style guide: gofmt, naming, error handling
  • Idiomatic patterns for interfaces, concurrency, and package organization

Go by the numbers

  • 2 all-time installs (skills.sh)
  • Ranked #74 of 98 Go skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/testdino-hq/google-styleguides-skills --skill go

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2
repo stars8
Last updatedFebruary 25, 2026
Repositorytestdino-hq/google-styleguides-skills

What it does

Applies Google's official Go style guide for formatting, naming, error handling, and idiomatic package organization.

Files

SKILL.mdMarkdownGitHub ↗

Google Go Style Guide

Official Google Go coding standards for idiomatic, maintainable code.

Golden Rules

1. Run `gofmt` before commit — formatting is non-negotiable 2. Short variable names in small scopes — i, err, ctx 3. Error handling, not exceptions — check every error 4. Interfaces for abstraction — accept interfaces, return structs 5. Defer for cleanup — ensure resources are released 6. Explicit is better — avoid magic, prefer clarity 7. Package names: lowercase, single word — no underscores

Quick Reference

Naming Conventions

ElementConventionExample
Packageslowercasepackage user
Fileslowercase_underscoreuser_service.go
TypesUpperCamelCaseUserService
Functions/MethodsUpperCamelCase (exported)GetUser
Functions/MethodslowerCamelCase (unexported)getUserByID
VariableslowerCamelCaseuserCount
ConstantsUpperCamelCase or UPPER_SNAKEMaxRetries
InterfacesUpperCamelCase + -er suffixReader, Writer

Variables

// ✓ CORRECT - short names in small scopes
for i := 0; i < 10; i++ {
    // ...
}

// ✓ CORRECT - descriptive names in larger scopes
func ProcessUserData(userRepository UserRepository) error {
    // ...
}

// ✗ INCORRECT - unnecessarily long
for index := 0; index < 10; index++ {
    // ...
}

Error Handling

// ✓ CORRECT - check every error
user, err := getUser(id)
if err != nil {
    return nil, fmt.Errorf("failed to get user: %w", err)
}

// ✗ INCORRECT - ignoring errors
user, _ := getUser(id)

Functions

// ✓ CORRECT - multiple return values
func GetUser(id int) (*User, error) {
    // ...
}

// ✓ CORRECT - named return values for clarity
func ParseConfig(path string) (cfg *Config, err error) {
    // ...
}

Interfaces

// ✓ CORRECT - small, focused interfaces
type Reader interface {
    Read(p []byte) (n int, err error)
}

// ✓ CORRECT - accept interfaces, return structs
func ProcessData(r Reader) (*Result, error) {
    // ...
}

Defer

// ✓ CORRECT - defer for cleanup
func ReadFile(path string) ([]byte, error) {
    f, err := os.Open(path)
    if err != nil {
        return nil, err
    }
    defer f.Close()
    
    return io.ReadAll(f)
}

Goroutines and Channels

// ✓ CORRECT - use context for cancellation
func ProcessItems(ctx context.Context, items []Item) error {
    for _, item := range items {
        select {
        case <-ctx.Done():
            return ctx.Err()
        default:
            if err := process(item); err != nil {
                return err
            }
        }
    }
    return nil
}

// ✓ CORRECT - buffered channels when appropriate
results := make(chan Result, len(items))

Package Organization

// ✓ CORRECT - package comment
// Package user provides user management functionality.
package user

// ✓ CORRECT - group imports
import (
    "context"
    "fmt"
    
    "github.com/pkg/errors"
    
    "myapp/internal/db"
)

Common Mistakes

MistakeCorrect Approach
Ignoring errorsCheck every error
Long variable names in loopsUse short names (i, j)
Panic for normal errorsReturn errors
Naked returnsUse explicit returns
Not running gofmtAlways format code
Underscores in package namesUse single lowercase word

When to Use This Guide

  • Writing new Go code
  • Refactoring existing Go
  • Code reviews
  • Setting up linting rules (golangci-lint)
  • Onboarding new team members

Install

npx skills add testdino-hq/google-styleguides-skills/go

Full Guide

See go.md for complete details, examples, and edge cases.

Related skills

Gobackenddocs

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.