3 ms·
It's my understanding that this is up to the maintainer; that is, if you release a major version, you can also backport bugfixes to the previous version. You c
by skybrian 9y ago
It's my understanding that this is up to the maintainer; that is, if you release a major version, you can also backport bugfixes to the previous version.
You can also import the new version from the old one, or vice-versa. So one approach would be to replace the old version with a wrapper that calls the new version, but exposes the old, backward-compatible API. (This would be a good idea if there are singletons.)
It's implicit in this scheme that major version bumps should be rare; you don't want to have to do this all the time. Presumably, library owners should save up breaking changes and do them all at once? But you could have multiple versions active at once, if you had to.
It's also the case that people often sneak in minor compatibility breaks without doing a version bump. (For Go this is happens pretty often for adding new fields to structs, which breaks embedding.) It's often a matter of what you can get away with without breaking most clients, rather than what's strictly a breaking change without considering usage.
- mjevans 9y agoI can see how that would break linkage, but if you're re-compiling everything that changed how is this actually an issue? Or is the issue that the broken code didn't depend on a publicly exposed part of the library's interface but instead copied something it shouldn't have?
- skybrian 9y agoSee "adding a field to a struct" on this page: https://blog.merovius.de/2015/07/29/backwards-compatibility-in-go.html https://blog.merovius.de/2015/07/29/backwards-compatibility-...