-
Notifications
You must be signed in to change notification settings - Fork 569
Closed
Labels
Description
Hey everyone!
First and foremost: thank you for this awesome piece of software! I've encountered a bug in which gopherjs handles interface calls on non-pointer receiver structs. It seems (to me) quiet severe but I couldn't find any bug that reported this. I'm on Go 1.10 and GopherJS 1.10-2.
When running this playground: https://play.golang.org/p/sIjx8DQWMpO. We see that struct fields modified in methods that do not have a pointer receiver indeed have no effect:
$ go run main.go
0 0
{0} 0
Running the same code using gopherjs https://gopherjs.github.io/playground/#/0pktxkdKEX will yield a different result: the modification to the non-pointer receiver is effective outside the call:
$ gopherjs run main.go
gopherjs: Source maps disabled. Install source-map-support module for nice stack traces. See https://github.com/gopherjs/gopherjs#gopherjs-run-gopherjs-test.
0 0
{1} 1
dmitshur and theclapp