askill
writing-go

writing-goSafety 95Repository

Idiomatic Go 1.25+ development. Use when writing Go code, designing APIs, discussing Go patterns, or reviewing Go implementations. Emphasizes stdlib, concrete types, simple error handling, and minimal dependencies.

16 stars
1.2k downloads
Updated 2/14/2026

Package Files

Loading files...
SKILL.md

Go Development (1.25+)

Core Principles

  • Stdlib first: External deps only when justified
  • Concrete types: Define interfaces at consumer, return structs
  • Composition: Over inheritance, always
  • Fail fast: Clear errors with context
  • Simple: The obvious solution is usually correct

Quick Patterns

Error Handling

if err := doThing(); err != nil {
    return fmt.Errorf("do thing: %w", err)
}

Struct with Options

type Server struct {
    addr    string
    timeout time.Duration
}

func NewServer(addr string, opts ...Option) *Server {
    s := &Server{addr: addr, timeout: 30 * time.Second}
    for _, opt := range opts {
        opt(s)
    }
    return s
}

Table-Driven Tests

tests := []struct {
    name    string
    input   string
    want    string
    wantErr bool
}{
    {"valid", "hello", "HELLO", false},
    {"empty", "", "", true},
}
for _, tt := range tests {
    t.Run(tt.name, func(t *testing.T) {
        got, err := Process(tt.input)
        if tt.wantErr {
            require.Error(t, err)
            return
        }
        require.NoError(t, err)
        assert.Equal(t, tt.want, got)
    })
}

Go 1.25 Features

  • testing/synctest: Deterministic concurrent testing with simulated clock
  • encoding/json/v2: Experimental, 3-10x faster (GOEXPERIMENT=jsonv2)
  • runtime/trace.FlightRecorder: Production trace capture on-demand
  • Container-aware GOMAXPROCS: Auto-detects cgroup limits
  • GreenTea GC: Experimental, lower latency (GOEXPERIMENT=greenteagc)

References

Tooling

go build ./...           # Build
go test -race ./...      # Test with race detector
golangci-lint run        # Lint
mockery --all            # Generate mocks

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

63/100Analyzed 2/20/2026

Well-structured Go development skill with practical code patterns and examples. Covers core principles, common patterns (error handling, options, table-driven tests), tooling, and references Go 1.25 features. Scores well on safety and reusability. Deducted points for: referencing external files not included in the skill, listing Go 1.25 features which is a non-existent version (current is ~1.21-1.22), and lack of explicit trigger/when-to-use section. The content appears somewhat generic/referential rather than step-by-step actionable.

95
70
75
50
72

Metadata

Licenseunknown
Version-
Updated2/14/2026
Publisherjulianobarbosa

Tags

ci-cdlintingtesting