go-nil-slice

Distinguish nil and empty slices for JSON and API responses.

3|Updated Nov 28, 2025
Search Tags:#go#nil#slice
One-click install
npx skills add https://github.com/JamesPrial/claudefiles --skill go-nil-slice
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-nil-slice
Source: https://github.com/JamesPrial/claudefiles/tree/main/skills/golang/nil/slice
Command: npx skills add https://github.com/JamesPrial/claudefiles --skill go-nil-slice

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Nil slices are valid, but encoding and iteration differ from empty slices.

Core Features & Use Cases

  • Nil vs Empty: Distinguish nil vs empty for JSON and APIs.
  • Append Semantics: Nil slices work with append to create a backing array.

Quick Start

Use nil for "no data" and []T{} for "empty data" in your API responses.