MCPcopy
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
201func ExampleResult_OrEmpty_ok() {
202 ok := Ok(42)
203 result := ok.OrEmpty()
204
205 fmt.Println(result)
206 // Output: 42
207}
208
209func ExampleResult_OrEmpty_err() {
210 ko := Err[int](err)

Callers

nothing calls this directly

Calls 2

OkFunction · 0.85
OrEmptyMethod · 0.45

Tested by

no test coverage detected