bingo icon indicating copy to clipboard operation
bingo copied to clipboard

Advice for integrated versions

Open codefromthecrypt opened this issue 3 years ago • 3 comments

github.com/envoyproxy/protoc-gen-validate is an example of something used both as a binary (codegen) and a library. It is very version sensitive, so bingo version has to match go.mod. bingo is still nice as it pins the version in protoc. what advice do you have for coupled versions between bingo and go.mod?

codefromthecrypt avatar Mar 17 '21 01:03 codefromthecrypt

Just to unpack this, do you mean having main go.mod and then bingo controlled protoc-gen-validate and ability to sync them.

Good point. Normally you need to update both places to have them synced. It is rare case, but one way would be to try add bingo mode that would reuse your main go.mod directly? 🤔 (Without auto replace logic). I think that could work.

Help wanted for PRs

bwplotka avatar Mar 24 '21 11:03 bwplotka

It won't be super easy, but doable. Open for other suggestions too

bwplotka avatar Mar 24 '21 11:03 bwplotka

I agree that re-using a version from go.mod would be the simplest and most likely to stay up to date. OTOH I also can understand this might be tricky, especially with replace statements.

Meanwhile updating both is I guess the best way out. Possibly the workaround could be to maybe check the version is the same somehow for the special case of this validate lib...

codefromthecrypt avatar Mar 25 '21 01:03 codefromthecrypt