How wlrgo/optres works
optres is a small Go library that glues the independent option.Option and result.Result packages together. Callers choose a conversion: Option-to-Result (OkOr, OkOrElse), Result-to-Option (Ok, Err), or one of the two transpose operations. The implementation delegates mapping and construction to the corresponding external package; OkOr also delegates to OkOrElse. The graph reflects the sampled implementation and README; the external packages’ internals are not represented.
Main entry points: optres.go OkOrElse
Components 9
Other components
- Go caller
- OkOr
optres.go - OkOrElse
optres.go - Ok
optres.go - Err
optres.go - TransposeOption
optres.go - TransposeResult
optres.go - option package
- result package
Connections 17
- Go caller → OkOr: calls
- Go caller → OkOrElse: calls
- Go caller → Ok: calls
- Go caller → Err: calls
- Go caller → TransposeOption: calls
- Go caller → TransposeResult: calls
- OkOr → OkOrElse: delegates
- OkOrElse → option package: maps option
- OkOrElse → result package: constructs result
- Ok → result package: maps result
- Ok → option package: constructs option
- Err → result package: maps result
- Err → option package: constructs option
- TransposeOption → option package: maps option
- TransposeOption → result package: maps result
- TransposeResult → result package: maps result
- TransposeResult → option package: maps option