confused about Get() method for optional & nullable
generic wrapper
#961
Unanswered
idledaemon
asked this question in
Q&A
Replies: 1 comment
-
The main reason of this is following semantic: if v, ok := foo.Value.Get(); ok {
println("Value is set to v")
} To save this semantic, v should be able to represent null value (e.g. This is not possible in Go, because we have no sum types. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example, if o.Null is true, should we return
v, true
?https://github.com/ogen-go/ogen/blob/7a4f230e80c90b3997328cd565661ca7fc33137c/gen/_template/schema/generic.tmpl#L75C13-L75C18
Beta Was this translation helpful? Give feedback.
All reactions