|
|
|
|
|
by TeeWEE
4209 days ago
|
|
Note that while interface upgrades are very usefull to use, they are not something very new in the programming language world. In java you could do: if (reader instanceOf BufferedReader) {
// upgrade
BufferedReader bReader = (BufferedReader) reader;
}
This is actualy adviced NOT to do, since its really a runtime type check.In Go its no different, as this article explains. However its still a usefull mechanism sometimes. |
|