Filter, map, and transform slices and maps in your Go applications without writing boilerplate code.
Group and chunk data for batch processing or organize results by category.
Implement fan-in/fan-out concurrency patterns using channel utilities.
Deduplicate, sort, and search collections with one-liner helper functions.
lo is a utility library for the Go programming language that brings the kind of compact, expressive helpers people are used to from JavaScript's Lodash. Its starting point is Go 1.18, the version that introduced generics: with generics, you can write a function once that works for any element type, which is what makes a clean Filter/Map/Reduce style finally possible in Go without copying the same function for every type you might pass in. Practically, the library is a single package (with a few sub-packages such as lo/parallel, lo/mutable, and lo/it) that adds dozens of small functions for working with slices, maps, strings, channels, tuples, time durations, and math. The slice section alone covers familiar moves like Filter, Map, Reduce, Uniq, GroupBy, Chunk, Flatten, Reverse, Shuffle, Take, Drop, Reject, Count, Replace, Compact, plus more specialized ones like Window, Sliding, PartitionBy, and CountValuesBy. The map section adds operations such as Keys, Values, PickBy, OmitBy, Entries, Invert, Assign, MapKeys, and MapValues. There are also set-style intersection helpers (Contains, Every, Some, Intersect, Difference, Union, Without), search helpers (IndexOf, Find, HasPrefix), string casers (PascalCase, CamelCase, KebabCase, SnakeCase), math helpers (Sum, Product, Mean, Mode, Range, Clamp), and channel helpers (FanIn, FanOut, Buffer, Generator) for concurrent code. Usage typically looks like calling lo.Uniq(...) on a slice and getting a deduplicated slice back, with the type figured out by the compiler. The author notes that a handful of helpers overlap with what is now in Go's standard slices and maps packages, but argues that lo still offers many more abstractions beyond those. The library has no dependencies outside the Go standard library, is at v1 and follows semantic versioning so exported APIs are stable until v2, and ships an AI-agent "skill" that other tools can install. You would reach for this library if you write Go and find yourself repeatedly writing the same small loops to filter, deduplicate, group, or transform collections, and would prefer one-line helpers that read clearly. The author also points to companion libraries, samber/mo for monadic types like Option and Result, samber/do for dependency injection, and samber/ro for reactive streams, if you want the rest of the same ergonomic style. The full README is longer than what was provided.
Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.