skills/smithery.ai/go-nil-pointer

go-nil-pointer

Installation
SKILL.md

Pointer Receiver Nil

Problem

Methods with pointer receivers can be called on nil. Must handle nil receiver.

Pattern

WRONG - Assume receiver is non-nil

type Tree struct {
    Value int
    Left  *Tree
}

func (t *Tree) Sum() int {
    return t.Value + t.Left.Sum()  // PANIC if t or t.Left is nil
}
Installs
1
First Seen
Apr 29, 2026
go-nil-pointer from smithery.ai