Hacker News new | ask | show | jobs
by trustno2 700 days ago
Your hypothetical issue is that you accidentally make a function conforming to an interface without actually meaning the same thing that the interface means?

That almost never happens in reality so it's not an issue.

For example, go has io.Reader which needs just `Read(p []byte) (n int, err error)`

Your issue is that you accidentally do Read with same signature, but it will mean something else, and the error it returns are different, so instead of EOF (as io reader should) it will return something else on end of file?

... it just doesn't happen in Go. You would need to go out of your way to break it. I guess it theoretically can happen.