gopherjs icon indicating copy to clipboard operation
gopherjs copied to clipboard

Methods all left out when converting from Go struct to js

Open haiyamicode opened this issue 12 years ago • 2 comments

Js objects converted from Go struct should still have all the methods as js prototype functions. Could it be supported? I think it's important. my usecase: I'm writing something based on rivetsjs and want to use something like this. I tried converting a Go struct to js, but the methods are all leaved out so the only workaround seems to be using a function property instead. However that's very ugly and there's no way to access the object itself.

haiyamicode avatar Jun 11 '14 22:06 haiyamicode

Is c2f03b5a0fc370a5929a993d3976549eacb9153c also a solution for you?

neelance avatar Jun 16 '14 23:06 neelance

yes it's working, thanks for the great work

haiyamicode avatar Jun 19 '14 13:06 haiyamicode