Open parabolala opened 4 years ago
GOPATH is going away within a year, so no point in supporting it. I think this rule just cannot be made to work the way it currently... works. It needs to be redone completely. See this issue for more details https://github.com/atlassian/bazel-tools/issues/118
On the other hand, if you use this rule and it would be convenient for you to have it with the patch, feel free to submit a PR. It will keep working while Go supports GOPATH and then it will stop. 🤷
Hi, I've hacked together a small patch that allows running
golangci-lint
on the generated go code. It relies on@rules_go/go_path
to assemble a source tree of all the dependencies and uses that asGOPATH
for thegolangci-lint
invocation.I've got it to work on my small repo that uses generated code for protobuf libraries and it works. The minimal patch to accept a
go_path()
output and wire it through GOPATH is at https://github.com/xa4a/bazel-tools/commit/3fd012ac23223a26b9f921fba5d86a82ea0d4a8cIt can be used as:
Am I missing something essential? Does this look feasible? If yes, I'll be happy to flesh it out into a PR.