# Bazel and Gopls

So Bazel and the Go language server gopls don’t get along very well. The problem is that Bazel generates a bunch of bazel-\* directories that gopls then tries to process, which can cause gopls to produce a slew of invalid warnings, run slowly, and sometimes even crash. The solution I’ve found so far is to add the following to my .bazelrc file:

build --symlink_prefix=_bazel_

Of course, a better solution would be for Go to support an ignore file like every other tool, ala .dockerignore, .gitignore, .bazelignore, etc. That’s tracked in proposal: global ignore mechanism for Go tool ecosystem, but given the push back from the core Go developers every time this issue is raised is “just sprinkle empty go.mod files in those directories”, which is both impractical and just a tad arrogant, I’m not very hopeful.