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
GopherJS's zero value for unsafe.Pointer is a numeric 0 (I'm guessing for interop with uintptr, but not entirely sure). However, this is incompatible with a pointer interface and causes incorrect behavior when converted into another pointer type:
package main
import (
"unsafe"
)
funcmain() {
varup unsafe.Pointerp:= (*bool)(up)
ifp!=nil {
println("error: p should be nil")
}
println("not nil", *p)
}
By contrast, if up is initialized with unsafe.Pointer((*bool)(nil)), the program works correctly.