Earlier quoted context omitted.
There's no need to reinvent the wheel. Semantic versioning already defines a standard for managing version changes in a pragmatic way. http://semver.org/
I think you either did not read the article or missed the point. Author says if you make _seemingly innocent non-breaking changes_ you might think it does not require a major version change in SemVer but in fact (for instance in case of adding struct fields) it does.
Backwards compatibility in Go (2015)
11–20 of 36 posts
Re: Backwards compatibility in Go (2015)
#12Re: Backwards compatibility in Go (2015)
#13Another reason for methods is a user could have created an interface based on your method, and assigned your implementing object to a variable of that type. Changing the method signature makes that assignment invalid.
Re: Backwards compatibility in Go (2015)
#14I imagine you could write a tool that would check the previous highest "v*" tag in git's version of the project vs now using something like go-guru and determine if any public interfaces were changed and that could automatically determine if it's a major or minor bump.
Re: Backwards compatibility in Go (2015)
#15It's not a problem in languages that come with a package manager, or at least promote a specific one to handle dependencies.
It's only a problem in languages where developers thinks "you don't need that". There is this weird belief in the Go community that Go is a miraculous language where good programming practices don't apply because Go magically make them irrelevant. It also stems from the Go team itself, which used to claim that "at Google, we don't need this or that" and then the Go community spreading the "gospel" : "Go doesn't suit you because it wasn't created for you"(?!?).
Hopefully Russ Cox sees that light, he even wrote a paper about "Go zealots" ( https://news.ycombinator.com/item?id=13356531 ) and how they refuse any change in the language, even when "teams at Google needs it". The irony
Re: Backwards compatibility in Go (2015)
#16Re: Backwards compatibility in Go (2015)
#17Re: Backwards compatibility in Go (2015)
#18Re: Backwards compatibility in Go (2015)
#19The author is essentially saying any API change has the potential to break backward compatibility and that we should define what kind of breakage is ok. That's kind of interesting, and I'd not considered many of the scenarios mentioned (which apply beyond go). Perhaps the "correct", but cumbersome thing to do is supply different versions of the API when maintaining backward compatibility and never change the old vers…
Most of these are treated as backwards incompatibilities by the stdlib folks and most users. The one that's not is that adding a field or method could break importing code. The scenario here is that you embed two types, one from the upgrading lib and one not, and the upgrading lib adds a name that collides with one in the other type. Rather than pick a winner in that conflict (last embed in the type definition wins,…
Yes, I'm not really talking about practical problems :) This article is mainly a response to various people claiming, "backwards compatibility is easy, it's a breakage if you are breaking the build".
FWIW, most of the scenarios you mention I wouldn't really call a backwards compatibility issue either, though. I'd say they are bugs that are exposed by a change in API.
Re: Backwards compatibility in Go (2015)
#20After I posted this I thought of writing a tool that checks if you are making breaking API changes in your go package. Turns out there is already one: https://github.com/bradleyfalzon/apicompat/