bwplotka / bingo

Like `go get` but for Go tools! CI Automating versioning of Go binaries in a nested, isolated Go modules.
Apache License 2.0
345 stars 29 forks source link

Advice for integrated versions #73

Open codefromthecrypt opened 3 years ago

codefromthecrypt commented 3 years ago

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?

bwplotka commented 3 years ago

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 commented 3 years ago

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

codefromthecrypt commented 3 years ago

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...