gopherjs icon indicating copy to clipboard operation
gopherjs copied to clipboard

Interface Assertions not Working in Specific Cases

Open DeedleFake opened this issue 8 years ago • 2 comments

I'm not sure what exactly causes this. I tried to narrow this down but, unfortunately, no matter what I tried, the narrowed down code worked as expected. However, the code that I originally found the problem in is available. The tests for a project I'm working on fail in GopherJS but work fine in standard Go. In GopherJS, it panics with the line

interface conversion: io.Writer is not io.writer: missing method Write

Somewhat complicating the matter is that the io package in question is not the standard library's io package; it's a different package that's part of the aforementioned project.

I'll keep trying to narrow it down and update if I find the cause, but I figured I'd post this with the information I have so far in case someone's able to figure it out faster.

DeedleFake avatar Oct 03 '17 20:10 DeedleFake

Have you tried temporarily renaming your own io package to see if the problem goes away?

theclapp avatar Oct 04 '17 13:10 theclapp

That's a much better idea than what I was planning. I was going to try to replicate the whole situation with a fake io package in a temporary $GOPATH.

That looks like it's the problem. I renamed the io package and it worked.

DeedleFake avatar Oct 04 '17 13:10 DeedleFake