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"
)
func main() {
var up unsafe.Pointer
p := (*bool)(up)
if p != 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.