golang / mock

GoMock is a mocking framework for the Go programming language.
Apache License 2.0
9.28k stars 610 forks source link

Did you release a minor that should have been a major? #255

Closed minitauros closed 5 years ago

minitauros commented 5 years ago

We're using gomock in our tests. Recently I installed (go get) gomock v1.2.0. My project was locked on v1.1.1. I made mocks using mockgen v1.2.0. Then when the tests ran, they used the locked in gomock v1.1.1. Stuff broke. You made the t field on one of the structs exported (T), resulting in errors like the following:

mocks/encoding.go:37:8: m.ctrl.T undefined (type *gomock.Controller has no field or method T, but does have gomock.t)

It's working now that I updated to v1.2.0, but just want to say that this doesn't look like a minor.

balshetzer commented 5 years ago

Hi Stephan,

First, I'm sorry you ran into this problem. I'm glad you were able to resolve it. Another possible fix would have been to download the v1.1.1 mockgen and use that.

It's my understanding that a major release is required when breaking backwards-compatibility. We labeled this release as a minor release because we believe it to preserve backwards-compatibility, i.e. if you update to this version then your existing code will continue to work.

I did not think that someone would use a newer version of mockgen while keeping an older version of the gomock package. My first instinct is to not support that. But I'm open to being convinced. Please re-open if you want to convince us that mockgen should not be allowed to generate code that breaks with any version of gomock within the same major version.

Thanks, Hesky