A Lodash-inspired utility library for Go providing essential functional programming and data manipulation functions.
gofp is a utility library for the Go programming language that provides essential functional programming and data manipulation functions. It addresses Go's lack of built-in utilities for working with slices and maps by offering Lodash-inspired functions that enable developers to write cleaner, more expressive code when handling collections and data transformations.
Go developers who need to work extensively with slices, maps, and data transformations, particularly those coming from JavaScript backgrounds who miss Lodash-style utilities.
Developers choose gofp because it brings familiar functional programming patterns to Go without requiring reflection, offers comprehensive collection utilities missing from the standard library, and enables more declarative and readable data manipulation code.
A super simple Lodash like utility library with essential functions that empowers the development in Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides Pipe, Compose, Map, Filter, and Reduce functions, enabling declarative data transformations as shown in the README's pipeline example.
Offers functions like Chunk, Reverse, Uniq, and GroupBy for common slice operations, filling gaps left by Go's limited built-in functions.
Includes Get for nested property access using path notation and Extend for deep map merging, simplifying complex data handling tasks.
Avoids the reflect package wherever possible, as stated in the philosophy, aiming for better performance in utility functions.
Relies on interface{} types, requiring manual type assertions that can lead to runtime panics instead of compile-time errors, undermining Go's static typing benefits.
Does not leverage Go's generics introduced in 1.18, making it less modern and efficient compared to newer libraries that offer type-safe alternatives.
Most functions, like Get or Map, do not provide built-in error handling for type mismatches or invalid paths, shifting burden to developers for validation.
gofp is an open-source alternative to the following products: