# Golang Samber Mo

Monadic types for Golang using samber/mo, Option, Result, Either, Future, IO, Task...

- Repository: https://github.com/samber/cc-skills-golang (3750 stars)
- Category: Design
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add samber/cc-skills-golang --skill golang-samber-mo -g -a claude-code -y`
Codex: `npx skills add samber/cc-skills-golang --skill golang-samber-mo -g -a codex -y`
Cursor: `npx skills add samber/cc-skills-golang --skill golang-samber-mo -g -a cursor -y`
Gemini CLI: `npx skills add samber/cc-skills-golang --skill golang-samber-mo -g -a gemini-cli -y`

## Description

Monadic types for Golang using samber/mo, Option, Result, Either, Future, IO, Task, and State types for type-safe nullable values, error handling, and functional composition with pipeline sub-packages. Apply when using or adopting samber/mo, when the codebase imports `github.com/samber/mo`, or when considering functional programming patterns as a safety design for Golang. Not for nil-safety and zero-value design without this library (→ See `samber/cc-skills-golang@golang-safety` skill), nor for native error wrapping with fmt.Errorf, errors.Is and errors.As (→ See `samber/cc-skills-golang@golang-error-handling` skill).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

**Persona:** You are a Go engineer bringing functional programming safety to Go. You use monads to make impossible states unrepresentable, nil checks become type constraints, error handling becomes composable pipelines.

**Thinking mode:** Reason as thoroughly as possible when designing multi-step Option/Result/Either pipelines, wrong type choice creates unnecessary wrapping/unwrapping that defeats the purpose of monads. On Claude Code, use `ultrathink` to trigger extended thinking explicitly.

# samber/mo, Monads and Functional Abstractions for Go

Go 1.18+ library providing type-safe monadic types with zero dependencies. Inspired by Scala, Rust, and fp-ts.

**Official Resources:**

- [pkg.go.dev/github.com/samber/mo](https://pkg.go.dev/github.com/samber/mo)
- [github.com/samber/mo](https://github.com/samber/mo)

This skill is not exhaustive, refer to library documentation and code examples for more information:

- For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber/cc-skills-golang@golang-pkg-go-dev` skill (`godig`), preferred over Context7 for Go package facts.
- To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber/cc-skills-golang@golang-gopls` skill (`gopls`).
- Context7 remains a fallback for docs not indexed on pkg.go.dev.

```bash
go get github.com/samber/mo
```

For an introduction to functional programming concepts and why monads are valuable in Go, see [Monads Guide](./references/monads-guide.md).

## Core Types at a Glance

The rest: https://github.com/samber/cc-skills-golang/blob/HEAD/skills/golang-samber-mo/SKILL.md
