go-knowledge-patch
Go 1.23+ Knowledge Patch
Claude's baseline knowledge covers Go through 1.22. This skill provides features from 1.23 (2024) onwards.
Quick Reference
Language Changes (1.26)
| Feature | Syntax |
|---|---|
| Pointer from expression | new(42), new(yearsSince(born)) |
| Self-referential generics | type Adder[A Adder[A]] interface { Add(A) A } |
See references/language-changes.md for details and migration patterns.
Standard Library (1.26)
| Package | Addition | Purpose |
|---|---|---|
errors |
AsType[T](err) |
Generic type-safe error matching |
bytes |
Buffer.Peek(n) |
Read next n bytes without advancing |
log/slog |
NewMultiHandler(h...) |
Fan out to multiple log handlers |
reflect |
Type.Fields(), .Methods(), .Ins(), .Outs() |
Iterator methods on types |
reflect |
Value.Fields(), .Methods() |
Iterator methods yielding type+value |
testing |
T.ArtifactDir() |
Directory for test output artifacts |
See references/stdlib-updates.md for full API details and examples.
Tooling (1.26)
| Command | Purpose |
|---|---|
go fix ./... |
Rewritten modernizer — updates code to current idioms |
//go:fix inline |
Directive for custom API migration rules |
See references/tooling.md for modernizer details.
Reference Files
| File | Contents |
|---|---|
language-changes.md |
new(expr), self-referential generic constraints |
stdlib-updates.md |
errors.AsType, bytes.Buffer.Peek, slog.NewMultiHandler, reflect iterators, testing artifacts |
tooling.md |
go fix modernizers, //go:fix inline directive |
Critical Knowledge
new(expr) Replaces ptr() Helpers (1.26)
The most common impact — eliminates the ubiquitous ptr[T any](v T) *T helper:
// Before: needed a helper or temp variable
func ptr[T any](v T) *T { return &v }
p := ptr(42)
// After: built-in
p := new(42)
p := new(yearsSince(born)) // useful for optional struct fields
errors.AsType — No More Temp Variables (1.26)
// Before
var pathErr *fs.PathError
if errors.As(err, &pathErr) {
use(pathErr)
}
// After — no separate variable needed
if pe, ok := errors.AsType[*fs.PathError](err); ok {
use(pe)
}
Reflect Iterators (1.26)
Range over struct fields, method sets, and function signatures:
for sf, v := range reflect.ValueOf(s).Fields() {
fmt.Println(sf.Name, v)
}
More from nevaberry/nevaberry-plugins
dioxus-knowledge-patch
Dioxus changes since training cutoff (latest: 0.7.4) — Signals replacing use_state, RSX macro overhaul, server functions, asset!() system, dx CLI, Element-as-Result. Load before working with Dioxus.
46rust-knowledge-patch
Rust changes since training cutoff (latest: 1.94.0) \u2014 Rust 2024 Edition, async closures, trait upcasting, new std APIs, cargo resolver v3. Load before working with Rust.
20postgresql-knowledge-patch
PostgreSQL changes since training cutoff (latest: 18.1) — JSON_TABLE, SQL/JSON functions, MERGE RETURNING, virtual generated columns, UUIDv7, temporal PRIMARY KEY. Load before working with PostgreSQL.
16bun-knowledge-patch
Bun changes since training cutoff (latest: 1.3.10) \u2014 S3 client, built-in SQL/Redis, route-based HTTP server, CSS bundler, V8 compatibility. Load before working with Bun.
14nextjs-knowledge-patch
Next.js changes since training cutoff (latest: 16.1) — proxy.ts, \"use cache\", Cache Components, navigation hooks, typed routes, auto PageProps, React 19.2. Load before working with Next.js.
14postgis-knowledge-patch
PostGIS changes since training cutoff (latest: 3.6.1) — SFCGAL CG_* rename, ST_CoverageClean, ST_AsRasterAgg, topology bigint IDs, viewport simplification, 3D SFCGAL ops. Load before working with PostGIS.
13