Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/samber/mo
/ ExampleResult_OrEmpty_ok
Function
ExampleResult_OrEmpty_ok
result_example_test.go:201–207 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
199
}
200
201
func
ExampleResult_OrEmpty_ok() {
202
ok := Ok(42)
203
result := ok.OrEmpty()
204
205
fmt.Println(result)
206
// Output: 42
207
}
208
209
func
ExampleResult_OrEmpty_err() {
210
ko := Err[int](err)
Callers
nothing calls this directly
Calls
2
Ok
Function · 0.85
OrEmpty
Method · 0.45
Tested by
no test coverage detected