3 ms·
type Optional struct { stuff interface{} present bool } func (o Optional) Get() (interface{}, bool) { return o.stuff, o.pre
by sacado2 11y ago
type Optional struct {
stuff interface{}
present bool
}
func (o Optional) Get() (interface{}, bool) {
return o.stuff, o.present
}
func NewOptional(stuff interface{}) {
return Optional(stuff, true)
}