Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/muratmirgun/gophers/go-data-structuresnpx skills add muratmirgun/gophers --skill go-data-structuresgit clone --depth 1 https://github.com/muratmirgun/gophersWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/muratmirgun/gophers/go-data-structures)<a href="https://agentmods.dev/skills/muratmirgun/gophers/go-data-structures"><img src="https://agentmods.dev/badge/skills/muratmirgun/gophers/go-data-structures.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00092 | $0.02306 |
| Opus 5 | $0.00046 | $0.01153 |
| Sonnet 5 | $0.00018 | $0.00461 |
| Haiku 4.5 | $0.00009 | $0.00231 |
Grade A, and why
go-data-structures scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 198 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Go Data Structures
Pick the structure that fits the access pattern — not the most familiar one. Slices and maps are the workhorses; arrays, container types, and the slices/maps packages cover the rest. Understanding the header layout, growth costs, and copy semantics of each turns most performance questions into one-line decisions.
Core Rules
- Slices and maps are reference types — assigning copies the header, not the data. Use
slices.Clone/maps.Clonefor a true copy. - Preallocate with
make([]T, 0, n)andmake(map[K]V, n)whenever the size is known or estimable. - Always assign the result of
append— the backing array may move. - Use
slicesandmapspackages (Go 1.21+) instead of hand-rolled helpers. map[K]struct{}is the canonical set — zero-byte values, no boolean ambiguity.strings.Builderfor string building,bytes.Bufferwhen you needio.Reader/io.Writer.
Picking a Structure
What do you need?
├─ Ordered, fixed compile-time size → [N]T array
├─ Ordered, dynamic size → []T slice
│ ├─ Known size → make([]T, 0, n)
│ └─ JSON output must be [] → []T{} literal (not nil)
├─ Key/value lookup → map[K]V
│ ├─ Need a set → map[K]struct{}
│ └─ Known size → make(map[K]V, n)
├─ Priority queue / top-k → container/heap
├─ Frequent middle insertion → container/list
├─ Fixed-size rolling window → container/ring
├─ Pure string building → strings.Builder
└─ Read+write of bytes → bytes.Buffer
Slice Internals
A slice is a 3-word header: pointer, length, capacity. Multiple slices can alias the same backing array — s[1:4] shares memory with s.
Capacity Growth
The exact algorithm has changed across versions; do not rely on it. As of recent Go:
len < 256→ capacity roughly doubles.len ≥ 256→ grows by ~25%.- Each growth allocates a new backing array and copies — O(n) per growth.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 198 lines · 92 tokens per session scan A 7a78729d0652
go-data-structures is a skill published in the GitHub repository muratmirgun/gophers (8 stars, last pushed 23d ago), licensed MIT. It adds 92 tokens to every session and 2,306 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
round-the-world
Round-the-world, Circle Pacific, and distance-based award products across alliances. Covers Star Alliance RTW, oneworld Explorer, Lufthansa M&M, Qantas, Cathay, JAL, Aeroplan, and Iberia charts.
scandinavia-transit
Search trains, buses, and ferries in Norway (Entur), Sweden (ResRobot), and Denmark (Rejseplanen). Intra-Scandinavia ground transport with schedules and Danish fare pricing.
seats-aero
Search award flight availability across 27 mileage programs via Seats.aero Partner API. Find cheapest award flights, compare programs, and get booking links.
ticketsatwork
Search TicketsAtWork (EBG corporate perks) for hotels, theme park tickets, attractions, and rental cars via Patchright. Often beats portals by 10-30%. Use when comparing hotel or ticket prices for a trip.
bilt
Search Bilt Rewards travel portal for cash and Bilt Points pricing on hotels and flights. Public REST API, no auth required. Includes Home Away From Home (HaFH) properties with $300+ benefits.
southwest
Search Southwest Airlines fares and points pricing via Patchright browser automation. SW is not in any GDS or API. Covers all fare classes, Companion Pass value, and fare drop monitoring.