Remove MustValue from optional type

This commit is contained in:
Elara 2023-10-04 20:47:30 -07:00
parent 46c74e6b9b
commit b22e50d439

View File

@ -39,14 +39,6 @@ func (o Optional[T]) IsValid() bool {
return o.value != nil return o.value != nil
} }
// MustValue returns the value in the optional. It panics if the value is nil.
func (o Optional[T]) MustValue() T {
if o.value == nil {
panic("optional value is nil")
}
return *o.value
}
// Value returns the value in the optional. // Value returns the value in the optional.
func (o Optional[T]) Value() (T, bool) { func (o Optional[T]) Value() (T, bool) {
if o.value != nil { if o.value != nil {