You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing an untyped nil should work, as that gets translated to null.
I'm unsure how to achieve an untyped nil or if it's the same as a nil of type interface{}.
But in either case, I wanted to ask/confirm. Is the fact that (interface{})(nil) gets externalized to a JavaScript null an officially supported feature of GopherJS (that I can/should rely on)?
If so, is it a natural property of Go, or is it a special behavior that should be documented somewhere (since it's currently undocumented as far as I can see)?
The text was updated successfully, but these errors were encountered:
This is a documentation issue/question.
From https://godoc.org/github.com/gopherjs/gopherjs/js, the only mention of things that get externalized to "null" is:
However, an
(interface{})(nil)
also gets externalized to a JavaScript null as far as I can tell:Also, in #145 (comment), @dominikh said:
I'm unsure how to achieve an untyped nil or if it's the same as a nil of type
interface{}
.But in either case, I wanted to ask/confirm. Is the fact that
(interface{})(nil)
gets externalized to a JavaScript null an officially supported feature of GopherJS (that I can/should rely on)?If so, is it a natural property of Go, or is it a special behavior that should be documented somewhere (since it's currently undocumented as far as I can see)?
The text was updated successfully, but these errors were encountered: