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
Fro http://golang.org/pkg/runtime/#SetFinalizer:
"The argument x must be a pointer to an object allocated by calling new or by
taking the address of a composite literal. The argument f must be a function that takes
a single argument of x's type and can have arbitrary ignored return values. If either of
these is not true, SetFinalizer aborts the program."
SetFinalizer does not, in fact, abort the program if the argument x is a the address of
a local object. I think the spec wording needs to be updated to reflect this.
http://play.golang.org/p/v8810GsAzF
The text was updated successfully, but these errors were encountered:
I wouldn't call this the spec--we usually use that word for the language spec. This is
just the documentation.
It is of course unsurprising that SetFinalizer works if you take the address of a local
variable. I agree that the docs should be updated though I think the update can be a
minor one.
The text was updated successfully, but these errors were encountered: