Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Cannot make a type in a foreign package implement an interface

The idiomatic way of adding an interface to a foreign type is to declare your own local alias and use that to implement the interface. At least then the added functionality is confined to a known package and won't lead to surprising behaviour elsewhere.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: