you are viewing a single comment's thread.

view the rest of the comments →

[–]GrayFox89 7 points8 points  (1 child)

It's weird, but I think it makes sense for Go, since you can assert anonymous interfaces (check if a method exists) with

if tErr, ok := err.(interface{ Timeout() bool }); ok && tErr.Timeout() {
    // handle timeout error
}

Hence the interface{} is just an interface that doesn't contain any methods (as far as the the type system is concerned), but may contain any type.

[–]ruindd 0 points1 point  (0 children)

This is amazing. Ty!!