MCPcopy
hub / github.com/cli/cli / Expect

Method Expect

pkg/option/option.go:128–134  ·  view source on GitHub ↗

Expect returns the underlying value for a [Some] variant, or panics with the provided message for a [None] variant.

(message string)

Source from the content-addressed store, hash-verified

126// Expect returns the underlying value for a [Some] variant, or panics with the
127// provided message for a [None] variant.
128func (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//

Calls

no outgoing calls