|
|
|
|
|
by floatingsmoke
2848 days ago
|
|
A bunch of pioneer project like docker, kubernetes, etcd, prometheus etc. has been built with go and I don't believe that the maintainers suffered lack of generics and error handlers. On the other hand, as a new go programmer, I can really dive into their code base and understand each line of code without thinking twice. This comes from simplicity. But these possible nested error handlers and generics will lead developers to think more than twice during writing or reading a code base. These ideas is not belong to go era but Java, C++ etc which go doesn't wanted to be like. Someone here has mentioned that internal support of generics for slices, maps and other primitives. I think this can be the best solution for generics in go. For the error handling I think more elegant way could be found. Please do not rush. |
|
Here's an experience report from k8s: https://medium.com/@arschles/go-experience-report-generics-i...
They've been using a code generator as a work around: https://github.com/google/gvisor/tree/master/tools/go_generi...