MCPcopy Create free account
hub / github.com/apache/fory / Unwrap

Method Unwrap

go/fory/optional/optional.go:53–58  ·  view source on GitHub ↗

Unwrap returns the contained value or panics.

()

Source from the content-addressed store, hash-verified

51
52// Unwrap returns the contained value or panics.
53func (o Optional[T]) Unwrap() T {
54 if o.has {
55 return o.value
56 }
57 panic("optional: unwrap on None")
58}
59
60// UnwrapOr returns the contained value or a default.
61func (o Optional[T]) UnwrapOr(defaultValue T) T {

Callers 2

Calls

no outgoing calls

Tested by 2