dot_claude/skills/go-expert/SKILL.md
Use when needing idiomatic, high-performance Go (v1.26) guidance for system-level logic, SIMD-accelerated algorithms, or memory-mapped storage engines.
npx skillsauth add nijaru/dotfiles go-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
os.Root for all file operations to prevent path traversal.ioutil (deprecated — use os/io directly).sort.Slice (use slices.Sort).interface{} (use any).reflect where generics or iterators suffice.context.TODO() in tests (use t.Context()).runtime.SetFinalizer (use runtime.AddCleanup — Go 1.24, supports multiple cleanups, no cycle leaks).//go:build with old syntax (use Go 1.17+ syntax).fmt.Sprintf("%s:%d", host, port) for addresses — use net.JoinHostPort (IPv6 safe; go vet hostport catches this, Go 1.25).sync.WaitGroup.Add inside the goroutine being counted — call before go (go vet waitgroup, Go 1.25).http://host:80:80/) — net/url.Parse rejects these (Go 1.26).new(expr) infers pointer type from expression (Go 1.26). Replaces v := x; &v patterns.
new(true) → *bool · new(int32(n)) → *int32 · new(f()) → *ReturnTypetype Set[T comparable] = map[T]struct{} (Go 1.24).type Node[T Node[T]] interface { Next() T }iter.Seq / iter.Seq2 and range-over-functions (Go 1.23+).
Seq[V any] is func(yield func(V) bool) · Seq2[K, V any] is func(yield func(K, V) bool)strings.Lines(s), strings.SplitSeq(s, sep), bytes.FieldsSeq(b) (Go 1.24)log/slog. NewMultiHandler fans out to multiple handlers (Go 1.26). Use LogAttrs() over Info()/Debug() in hot paths — skips key-value boxing.slices and maps packages for all generic operations.github.com/go-json-experiment/json (v2) for new code — case-sensitive by default, RejectUnknownMembers option, functional options at call site, richer struct tags. API still evolving; pin your version. Also available as encoding/json/v2 with GOEXPERIMENT=jsonv2.
omitzero struct tag available in standard encoding/json since Go 1.24 (no v2 required).os.Root sandboxes all filesystem access including symlinks (Go 1.24). Methods mirror the os package.crypto/hpke for Hybrid Public Key Encryption (RFC 9180). crypto/tls enables SecP256r1MLKEM768 by default (Go 1.26).os/signal.NotifyContext cancels with cause — use context.Cause(ctx) to identify which signal fired (Go 1.26).weak.Pointer[T] for memory-efficient caches and canonicalization maps (Go 1.24). Pair with runtime.AddCleanup.sync/atomic (e.g., atomic.Pointer[T]).sync.WaitGroup.Go — replaces Add(1); go func() { defer Done() }() (Go 1.25).simd/archsimd (Go 1.26, experimental, GOEXPERIMENT=simd) for vectorized hot paths — Float32x4, Int32x4, etc. with Load/Store/Add/Mul/MulAdd ops.testing/synctest for deterministic concurrent tests with virtual clocks (Go 1.25+).b.Loop() (Go 1.24) — automatic timer management, exactly-once-per-count, keeps variables alive. In Go 1.26, no longer blocks inlining of the loop body.panic (not log.Fatal) for invariant violations — things that should never happen, not user/input errors. log.Fatal calls os.Exit and skips defers.self/this. (c *Client), (srv *Server).users not userSlice; count not numUsers. Only qualify when two forms coexist (age/ageStr).r io.Reader, w io.Writer — fixed conventions.http.Client not http.HTTPClient. No cryptic abbreviations.errors.AsType[T](err) (Go 1.26).
if e, ok := errors.AsType[*MyErr](err); ok { ... }
fmt.Errorf("...: %w", err).go fix to migrate to current idioms. Preview with go fix -diff ./....runtime/trace.FlightRecorder (Go 1.25) — ring-buffer trace capture for production; call WriteTo on significant events.GOEXPERIMENT=goroutineleakprofile → /debug/pprof/goroutineleak. No overhead unless queried. Expected default in Go 1.27.tool directive in go.mod for dev tools (Go 1.24+). Run with go tool <pkg>.go.work for multi-module development.goimports → golines --base-formatter gofumpt.go mod tidy after every dependency change.development
Use after completing a bug fix, feature, refactor, or tk task when the first implementation taught enough context to replace it with a simpler, cleaner, or more coherent version before finalizing.
development
Use when writing, migrating, or reviewing Zig code across recent stable versions (0.14-0.16), especially to correct stale syntax or stdlib, build.zig, allocator, formatting, or runtime API knowledge.
documentation
Use when reviewing or revising text (prose, docs, commits) to remove AI patterns and improve voice/clarity.
content-media
Use when fetching X/Twitter post content by URL, or searching for recent X posts.