In a multi-language repository—for example, one that includes both Go and Ruby—you can run into conflicts around the vendor/ directory. Ruby commonly uses a vendor/ directory to store dependencies, but Go’s toolchain assumes that a vendor/ directory follows its own vendoring format (including the modules.txt file that defines vendored modules).
If Ruby’s vendor/ directory is present, the Go toolchain may attempt to interpret it as a Go vendoring directory, leading to unexpected errors.
To prevent this, configure Go to use module mode explicitly and ignore the vendor/ directory (which, in this case, is only relevant to Ruby):
- Add
-mod=modto commands such asgo buildandgo test. - Set a global flag with
export GOFLAGS=-mod=modfor commands likego toolthat do not expose a-modflag directly.