golang-samber-lo

Transform Go slices and maps with type-safe lodash-inspired helpers.

1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/dashkan/pivox --skill golang-samber-lo-dashkan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-samber-lo
Source: https://github.com/dashkan/pivox/tree/main/.agents/skills/golang-samber-lo
Command: npx skills add https://github.com/dashkan/pivox --skill golang-samber-lo-dashkan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

samber/lo eliminates repetitive for-loops when you need to transform, filter, group, deduplicate, and reduce slices and maps in Go while keeping code concise and type-safe.

Core Features & Use Cases

  • Functional, immutable collection transforms: Map, Filter, Reduce, GroupBy, Chunk, Flatten, and more without mutating inputs.
  • Error-aware variants: MapErr/FilterErr/ReduceErr style helpers that propagate errors cleanly.
  • Performance-aware options: Use lop (parallel CPU-bound transforms), lom (in-place mutations), or loi (lazy iterators for Go 1.23+) when profiling shows it’s needed.

Quick Start

Use the golang-samber-lo skill to rewrite your existing slice-and-map transformation logic using lo.Map, lo.Filter, and lo.GroupBy for clearer, safer, declarative code.

Frequently Asked Questions about golang-samber-lo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I replace manual for-loops with functional slice transforms in Go?

Error-aware collection mapping in Go works by using MapErr and FilterErr helpers that automatically halt transformation and propagate the error cleanly back to the caller without requiring manual error checking inside loops.

Does Go support immutable and type-safe functional programming for slice processing?

Parallel collection processing in Go is handled by the lop mode, which executes CPU-bound transforms concurrently, while lazy iterator mode uses Go 1.23+ features to process items on-demand and reduce unnecessary allocations.

What's the best way to group, chunk, and flatten slices in Go without writing repetitive loops?

In-place mutable collection transforms in Go are supported via the lom mode, which allows you to modify the underlying slice directly during processing to optimize memory usage and allocation overhead when performance profiling demands it.

When should I use lazy iterators versus parallel processing for Go slice transformations?

You should use lazy iterators for Go slice transformations to minimize memory allocations on large datasets, and switch to parallel processing mode when profiling shows CPU-bound operations require concurrent execution.