From go-knowledge-patch
Supplies Go 1.23+ knowledge including new(expr) builtin, errors.AsType, self-referential generics, reflect iterators, and go fix modernizer. Load for post-1.22 Go development.
npx claudepluginhub nevaberry/nevaberry-plugins --plugin go-knowledge-patchThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Implements structured self-debugging workflow for AI agent failures: capture errors, diagnose patterns like loops or context overflow, apply contained recoveries, and generate introspection reports.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Claude's baseline knowledge covers Go through 1.22. This skill provides features from 1.23 (2024) onwards.
| 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.
| 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.
| 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.
| 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 |
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)
}
Range over struct fields, method sets, and function signatures:
for sf, v := range reflect.ValueOf(s).Fields() {
fmt.Println(sf.Name, v)
}