func ExampleOption_MustGet_none() { none := None[int]() result := none.MustGet() fmt.Println(result) // Output: panics }
()
| 161 | // } |
| 162 | |
| 163 | func ExampleOption_OrElse_some() { |
| 164 | some := Some(42) |
| 165 | result := some.OrElse(1234) |
| 166 | |
| 167 | fmt.Println(result) |
| 168 | // Output: 42 |
| 169 | } |
| 170 | |
| 171 | func ExampleOption_OrElse_none() { |
| 172 | none := None[int]() |