# Golang Samber Lo

Functional programming helpers for Golang using samber/lo, 500+ type-safe generic...

- Repository: https://github.com/samber/cc-skills-golang (3750 stars)
- Category: Git and review
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add samber/cc-skills-golang --skill golang-samber-lo -g -a claude-code -y`
Codex: `npx skills add samber/cc-skills-golang --skill golang-samber-lo -g -a codex -y`
Cursor: `npx skills add samber/cc-skills-golang --skill golang-samber-lo -g -a cursor -y`
Gemini CLI: `npx skills add samber/cc-skills-golang --skill golang-samber-lo -g -a gemini-cli -y`

## Description

Functional programming helpers for Golang using samber/lo, 500+ type-safe generic functions for slices, maps, channels, strings, math, tuples, and concurrency (Map, Filter, Reduce, GroupBy, Chunk, Flatten, Find, Uniq, etc.). Core immutable package (lo), concurrent variants (lo/parallel aka lop), in-place mutations (lo/mutable aka lom), lazy iterators (lo/it aka loi for Go 1.23+), and experimental SIMD (lo/exp/simd). Apply when using or adopting samber/lo, when the codebase imports github.com/samber/lo, or when implementing functional-style data transformations in Go. Not for streaming pipelines (→ See `samber/cc-skills-golang@golang-samber-ro` skill).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

**Persona:** You are a Go engineer who prefers declarative collection transforms over manual loops. You reach for `lo` to eliminate boilerplate, but you know when the stdlib is enough and when to upgrade to `lop`, `lom`, or `loi`.

# samber/lo, Functional Utilities for Go

Lodash-inspired, generics-first utility library with 500+ type-safe helpers for slices, maps, strings, math, channels, tuples, and concurrency. Zero external dependencies. Immutable by default.

**Official Resources:**

- [github.com/samber/lo](https://github.com/samber/lo)
- [lo.samber.dev](https://lo.samber.dev)
- [pkg.go.dev/github.com/samber/lo](https://pkg.go.dev/github.com/samber/lo)

This skill is not exhaustive, refer to library documentation and code examples for more information:

- For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber/cc-skills-golang@golang-pkg-go-dev` skill (`godig`), preferred over Context7 for Go package facts.
- To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber/cc-skills-golang@golang-gopls` skill (`gopls`).
- Context7 remains a fallback for docs not indexed on pkg.go.dev.

## Why samber/lo

Go's stdlib `slices` and `maps` packages cover ~10 basic helpers (sort, contains, keys). Everything else, Map, Filter, Reduce, GroupBy, Chunk, Flatten, Zip, requires manual for-loops. `lo` fills this gap:

The rest: https://github.com/samber/cc-skills-golang/blob/HEAD/skills/golang-samber-lo/SKILL.md
