Interface Assertions not Working in Specific Cases
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.
Have you tried temporarily renaming your own io package to see if the problem goes away?
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.