What problem does it solve?
This Skill helps you replace unsafe nil checks and repetitive error handling with type-safe monadic composition in Go, reducing bugs caused by missing values and mismanaged failures.
Core Features & Use Cases
- Option[T] for absence without nil: Model nullable values (including JSON and SQL nullable columns) using Some/None patterns instead of *T and manual checks.
- Result[T] for error-aware pipelines: Represent success or failure as values so multi-step transformations can short-circuit automatically.
- Either[L, R] for two valid alternatives: Use Left/Right to model cases where neither branch is inherently an error (e.g., cached vs fresh data).
- Advanced types and composition: Cover Future/IO/Task/State for async, deferred side effects, and stateful computations, with guidance on when to choose each.
- Correct Go generics usage: Explain why type-changing operations require sub-packages (option/result/either pipelines) or mo.Do, since Go methods cannot introduce new type parameters.
Quick Start
Use the golang-samber-mo skill when you need to turn nullable fields, fallible operations, or cached-vs-fresh branching into composable, type-checked pipelines in Go.