golang-samber-lo

Enable type-safe functional transforms on Go slices and maps with samber/lo.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go's standard library offers limited ergonomic helpers for functional-style data transforms; samber/lo provides a comprehensive, type-safe set of generics-based helpers for slices, maps, channels, strings, and more, enabling concise, immutable data processing without boilerplate.

Core Features & Use Cases

  • Map, Filter, Reduce, GroupBy, Chunk, Flatten, Uniq and many more core helpers for slices and maps.
  • Parallel (lop), Mutable (lom), Lazy (loi for Go 1.23+), and Experimental SIMD (lo/exp/simd) variants to cover performance and memory trade-offs.
  • Ideal for Go projects requiring declarative data transformations, data pipelines, and utility libraries with strong type-safety.

Quick Start

Use lo.Map to transform a slice into a new slice without mutating the input.

Frequently Asked Questions about golang-samber-lo

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

FAQPage Schema
How do I apply functional transformations like Map and Filter to slices in Go?

You can perform functional transformations on slices in Go using samber/lo, which provides type-safe generics-based helpers for Map, Filter, Reduce, and GroupBy without boilerplate. It enables concise, immutable data processing on slices and maps.

What is the best way to group or chunk data in Go without writing boilerplate loops?

The best way to group or chunk data in Go is using samber/lo's comprehensive helpers like GroupBy and Chunk, which offer type-safe, immutable data transforms for slices and maps, eliminating manual loop boilerplate.

Does this functional utility library require a specific version of Go?

Yes, this functional utility library requires Go 1.18 or higher for core immutable operations, while the lazy iteration variants (loi) specifically require Go 1.23 or later. It relies on Go's built-in generics for type safety.

Can I run parallel or lazy data transformations in Go using samber/lo?

Yes, you can run parallel or lazy data transformations in Go using samber/lo variants, which include parallel (lop), mutable (lom), and lazy iterator (loi) options to cover various performance and memory trade-offs.

Are there any external runtime dependencies needed for type-safe data processing in Go?

No, there are zero external runtime dependencies needed for type-safe data processing in Go with samber/lo. It only requires importing github.com/samber/lo and leverages Go's standard library and built-in generics.