4 ms·
This is the way: Use new major versions for stdlib packages, e.g., sort/v2
by 37ef_ced3 5y ago
This is the way:
Use new major versions for stdlib packages, e.g., sort/v2
- xyzzy_plugh 5y agoCertainly this is true, but I wouldn't put it past rsc & co to find some magical incantation that provides full backwards compatibility. In particular the alias keyword was quite succinct and not abused much.
- tikkabhuna 5y agoSounds like a nightmare for newbies getting started. If this is the way forward, and I agree its the most Go-like, I would like to see good support for warning users to use v2 and why they need to.
- YesThatTom2 5y agoQuite the opposite. Naive users will not be affected. They’ll just use generics and not realize that for certain types the code generated is more specific. Or are you assuming newbies read the standard library source?
- bradleyankrom 5y agoI know a lot of “get started with Go” blog posts, books, etc recommend going through the standard library code to see conventions in practice. Go’s stdlib is relatively easy to read, especially if the consumer has some previous experience with other languages.
- nirui 5y agoI don't think it would be that easy. Think how the maintainers of third-party package will maintain their package after this: before, they just need to target the one and only `atomic` (or any other package mentioned in the GitHub discussion), now they might have to target both `atomic` and `atomic/v2` just to support generics. I really hope they could come up a cleaner solution than this.