Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/samber/mo
/ ExampleResult_ok
Function
ExampleResult_ok
result_example_test.go:81–88 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
79
}
80
81
func
ExampleResult_ok() {
82
ok := Ok(42)
83
result := ok.OrElse(1234)
84
_err := ok.Error()
85
86
fmt.Println(result, _err)
87
// Output: 42 <nil>
88
}
89
90
func
ExampleResult_err() {
91
ko := Err[int](err)
Callers
nothing calls this directly
Calls
3
Ok
Function · 0.85
Error
Method · 0.80
OrElse
Method · 0.45
Tested by
no test coverage detected