()
| 43 | } |
| 44 | |
| 45 | func ExampleOption_UnwrapOrElse() { |
| 46 | fmt.Println(o.Some(4).UnwrapOrElse(func() int { |
| 47 | return 3 |
| 48 | })) |
| 49 | |
| 50 | fmt.Println(o.None[int]().UnwrapOrElse(func() int { |
| 51 | return 3 |
| 52 | })) |
| 53 | |
| 54 | // Output: |
| 55 | // 4 |
| 56 | // 3 |
| 57 | } |
| 58 | |
| 59 | func ExampleOption_UnwrapOrZero() { |
| 60 | fmt.Println(o.Some(4).UnwrapOrZero()) |
nothing calls this directly
no test coverage detected