This commit is contained in:
@@ -57,3 +57,11 @@ func (m JsonOpt[T]) MustValue() T {
|
||||
}
|
||||
return m.value
|
||||
}
|
||||
|
||||
func (m JsonOpt[T]) IfSet(fn func(v T)) bool {
|
||||
if !m.isSet {
|
||||
return false
|
||||
}
|
||||
fn(m.value)
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user