Analysis updated 2026-06-21
Replace repetitive slice-filtering loops in Go with one-line calls like lo.Filter and lo.Map.
Group, deduplicate, or transform Go slices and maps without writing custom helper functions each time.
Use lo/parallel to process large collections concurrently across goroutines with the same clean API.
Perform set operations like Intersect, Union, and Difference on Go slices in a single line.
| samber/lo | chaitin/safeline | lima-vm/lima | |
|---|---|---|---|
| Stars | 21,227 | 21,226 | 20,954 |
| Language | Go | Go | Go |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 4/5 | 3/5 |
| Audience | developer | ops devops | developer |
Figures from each repo's GitHub metadata at analysis time.
lo is a utility library for the Go programming language by Samuel Berthe. It brings to Go the kind of compact, expressive helpers that JavaScript developers know from Lodash. The starting point is Go 1.18, the version that introduced generics. Generics let you write one function that works for any element type, which is what makes a clean Filter, Map, and Reduce style possible in Go without rewriting the same function for every type. The library is a single Go module with a few sub-packages. The main package adds dozens of small functions for working with slices, maps, strings, channels, tuples, time durations, and math. There is a parallel sub-package called lo/parallel for running those helpers across goroutines, a mutable sub-package called lo/mutable that modifies the input in place when that is faster, and an iterator-based sub-package called lo/it. Installation is one go get command, and the library has no dependencies outside the Go standard library. The author keeps it at v1 and follows semantic versioning, so exported APIs will not change before v2. The slice section alone covers familiar moves like Filter, Map, Reduce, Uniq, GroupBy, Chunk, Flatten, Reverse, Shuffle, Take, Drop, Reject, Count, Replace, and Compact, along with more specialised 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 set helpers such as Contains, Every, Some, Intersect, Difference, Union, and Without. There are string casers for PascalCase, CamelCase, KebabCase, and SnakeCase. There are math helpers for Sum, Product, Mean, Mode, Range, and Clamp. There are channel helpers such as FanIn, FanOut, Buffer, and Generator for concurrent code. The author notes that a few of the helpers overlap with what is now in Go's standard slices and maps packages, but argues the library still offers many more shapes beyond those. You would reach for lo if you write Go and find yourself 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 sibling libraries: samber/mo for option and result types, samber/do for dependency injection, and samber/ro for reactive streams over infinite data sources.
lo is a Go utility library that adds Lodash-style helpers like Filter, Map, GroupBy, and Uniq for slices, maps, and channels, all type-safe using Go generics, with no external dependencies.
Mainly Go. The stack also includes Go.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.