3 ms·
2. Not a change per-se, but the core team are now often seen using var _ InterfaceType = Struct{} to declare that a type conforms to an interface (which will al
by randomdata 9y ago
2. Not a change per-se, but the core team are now often seen using var _ InterfaceType = Struct{} to declare that a type conforms to an interface (which will also generate a compiler error if it fails to). This seems to convey the same intent to the reader. Neither solution, as originally noted, will catch bugs in the implementation.
3. Tooling will catch when you are not appropriately handling errors, although I'm a little bit surprised this didn't already exist in 2016. But I'll assume it didn't. It certainly does now.
6. Again, not a change, but the patterns to make this a non-issue are perhaps better understood now. The points are short on intimate details, so it is difficult to determine if the problem is a result of the author not being entirely familiar with the language the way that people are today, or if there is a particular edge case that the rest of us might not consider.
8. The sort package has addressed this concern.
9. Go has had a solution for versioning from the very start, so I'm not quite sure what the parent is referring to. It was indeed a terrible solution for many organizations, but a lot of work has been done to improve on that. For all intents and purposes this is no longer an issue.
- parenthephobia 9y ago> The sort package has addressed this concern. How? Looking at the documentation, you still have to write at least three functions for each type you want to sort.
- randomdata 9y agoAn example from the docs: sort.Slice(people, func(i, j int) bool { return people[i].Name < people[j].Name })