golang-samber-lo

Automate functional programming transformations in Go using samber/lo.

Updated Jun 27, 2026
One-click install
npx skills add https://github.com/LuigiAPCPereira/evolutiondocs --skill golang-samber-lo-luigiapcpereira
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-samber-lo
Source: https://github.com/LuigiAPCPereira/evolutiondocs/tree/main/.agents/skills/golang-samber-lo
Command: npx skills add https://github.com/LuigiAPCPereira/evolutiondocs --skill golang-samber-lo-luigiapcpereira

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires github.com/samber/lo, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the need for efficient, type-safe transformations in Go, reducing boilerplate and enhancing code clarity.

Core Features & Use Cases

  • Functional Programming: Provides 500+ type-safe generic functions for slices, maps, channels, and more.
  • Immutability: Returns new collections to avoid side effects and simplify reasoning.
  • Composability: Functions are designed to chain, allowing for complex transformations with minimal boilerplate.
  • Use Case: If you're working on a Go project and find yourself writing many for-loops for operations like filtering, mapping, or reducing, this skill can help you replace them with more expressive, idiomatic code.

Quick Start

Use the golang-samber-lo skill to apply transformations to a slice of user records. For example, to filter and map the 'Name' field:

golang-samber-lo -s users -o names --filter active -map name

Frequently Asked Questions about golang-samber-lo

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

FAQPage Schema
How do I reduce boilerplate when transforming slices and maps in Go?

You can reduce Go boilerplate by using type-safe functional transformations to filter, map, and reduce collections. This approach replaces verbose for-loops with composable function chains that return new collections, avoiding side effects.

What is the best way to apply functional programming to Go collections?

Functional programming in Go collections is best handled by using generic utility functions for slices, maps, and channels. This allows you to chain transformations like filtering and mapping with minimal boilerplate while maintaining type safety.

Does the samber/lo library support type-safe tuple and channel transformations?

Yes, the samber/lo library supports type-safe transformations for slices, maps, channels, strings, and tuples. It provides over 500 generic functions designed to enable expressive, functional data transformations in Go.

How do I filter and map fields from a slice of structs in Go?

To filter and map fields from a Go slice, you can chain type-safe functional transformations. For example, you can pass a slice of user records through a filter for active users and then map the result to extract specific fields like names.

Can I use functional transformations to avoid side effects when modifying Go data structures?

Yes, functional transformations avoid side effects by returning entirely new collections instead of modifying the original data structures. This immutability simplifies reasoning about your Go code and prevents unexpected state mutations.

When should I avoid replacing standard Go for-loops with functional transformations?

You should avoid functional transformations if your project does not use the samber/lo library or if you are not using Go. This approach is designed specifically for AI coding assistants and Go projects requiring type-safe data transformations.