Skip to content
Agentmart
Submit a tool

golang-data-structures

Choose or review Go collections and memory representations when access patterns, ownership, copying, allocation, or generic APIs matter.

Skill by reagin

IndexedMIT
Write a review

Chalk Labs

Need help deploying golang-data-structures?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/reagin-golang-data-structures

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Choose or review Go collections and memory representations when access patterns, ownership, copying, allocation, or generic APIs matter. Use for slices, maps, arrays, standard containers, pointers, and custom generic structures; not for synchronization design or speculative micro-optimization.

Use cases: design, data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/golang-data-structures

What's inside

Skill name
golang-data-structures
Description
Choose or review Go collections and memory representations when access patterns, ownership, copying, allocation, or generic APIs matter. Use for slices, maps, arrays, standard containers, pointers, and custom generic structures; not for synchronization design or speculative micro-optimization.
License
MIT
Instructions
58 lines in SKILL.md · view on GitHub

Files (6)

  • SKILL.md
  • containers.md · references/
  • generics.md · references/
  • map-internals.md · references/
  • pointers.md · references/
  • slice-internals.md · references/

SKILL.md (first lines)

# Go Data Structures

Choose the simplest representation that satisfies the operation, ownership, and lifecycle requirements. Internal runtime layouts and growth policies are implementation details unless the current toolchain documents them as API.

## Gather requirements

Before changing a representation, inspect nearby code, `go.mod`, tests, serialization contracts, concurrency, and performance evidence. Determine:

- dominant operations and their required complexity;
- expected and worst-case size;
- insertion, deletion, and ordering requirements;
- uniqueness and key equality rules;
- mutation and ownership across API boundaries;
- whether nil, empty, and absent have distinct external meaning;
- whether the structure is shared concurrently;
- whether allocation or retention is a measured concern.

Do not replace a familiar built-in type with a custom container solely for theoretical complexity at small sizes.

## Selection guide

| Need | Starting point | Important trade-off |
| --- | --- | --- |
| Ordered, indexable sequence | Slice | Append can replace the backing array; subslices can retain or alias data |
| Fixed-size comparable value | Array | Assignment copies the full value; size is part of the type |
| Keyed lookup | Map | Iteration order is unspecified; map access is not safe with concurrent writes |
| Set membership | `map[T]struct{}` or project type | Decide whether a named abstraction improves the API |
| Priority queue | `container/heap` | Interface adapter and heap invariant |
| O(1) removal with a retained node handle | `container/list` | Allocation and poor locality often lose to slices otherwise |
| Fixed circular traversal | `container/ring` or a slice-based ring | Choose based on indexing, storage, and mutation needs |
| String construction | `strings.Builder` | Builder is write-only and must not be copied after use |
| Read/write byte buffer | `bytes.Buffer` | Exposes byte-oriented I/O and mutable storage |

Read [container choices](references/containers.md) when a standard container or buffering API is under consideration.

## Stable semantics

- Preallocate a slice or map when a credible size estimate exists and the allocation matters. Do not reserve a large worst case without evidence.
- Treat slice assignment, reslicing, and map assignment as sharing underlying state. Clone at ownership boundaries when independent mutation is required.
- Treat nil and empty according to the API contract. Both can be idiomatic; they differ in some encodings and in whether a map can be written.
- Do not depend on a particular slice growth factor, map bucket layout, or whether deleted map storage is returned to the runtime.
- Map iteration order must not drive deterministic output. Collect and sort keys when order is part of the contract.
- A value stored in a map cannot be addressed directly. Copy-modify-store or use pointers when identity and mutation semantics justify them.

See [slice semantics](references/slice-internals.md) and [map semantics](references/map-internals.md) for aliasing, retention, and copying decisions.

## Generics and pointers

Use generics when one algorithm or representation is genuinely identical across types and the constraint expresses the required operations. Prefer a concrete type or interface when behavior differs by domain. See [generic collections](references/generics.md).

Choose values or pointers based on identity, mutation, optionality, copying, allocation, and API contracts—not a universal byte threshold. Use `unsafe` only for a demonstrated low-level requirement and verify against the current toolchain documentation. See [pointer choices](references/pointers.md).

## Verification

Add tests for observable semantics: ordering, duplicate handling, nil/empty behavior, aliasing, boundary ownership, and error cases. Benchmark only when the choice is performance-sensitive under representative sizes. If concurrency is involved, design synchronization separately; changing the container does not make an ownership protocol safe.

From reagin/agent-skills, MIT.

More from reagin/agent-skills

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Aug 25, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from reagin

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get golang-data-structures running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying golang-data-structures?

CallGet help
Cite this page

golang-data-structures skill. Agent Mart. https://agentmart.dev/skills/reagin-golang-data-structures (last updated 2026-10-24)