Expect returns the underlying value for a [Some] variant, or panics with the provided message for a [None] variant.
(message string)
| 126 | // Expect returns the underlying value for a [Some] variant, or panics with the |
| 127 | // provided message for a [None] variant. |
| 128 | func (o Option[T]) Expect(message string) T { |
| 129 | if o.present { |
| 130 | return o.value |
| 131 | } |
| 132 | |
| 133 | panic(message) |
| 134 | } |
| 135 | |
| 136 | // Map applies a function to the contained value of (if [Some]), or returns [None]. |
| 137 | // |
no outgoing calls