()
| 209 | } |
| 210 | |
| 211 | func ExampleOption_Match_some() { |
| 212 | some := Some(42) |
| 213 | result := some.Match( |
| 214 | func(i int) (int, bool) { |
| 215 | return 0, false |
| 216 | }, |
| 217 | func() (int, bool) { |
| 218 | return 2, true |
| 219 | }, |
| 220 | ) |
| 221 | |
| 222 | fmt.Println(result.IsPresent(), result.OrEmpty()) |
| 223 | // Output: false 0 |
| 224 | } |
| 225 | |
| 226 | func ExampleOption_Match_none() { |
| 227 | none := None[int]() |