3 ms·
> Right now, "module mode" is mutually exclusive with "vendor mode" and I don't think there are any plans to change that. This is not true. If you pass -mod=ve
by EdiX 8y ago
> Right now, "module mode" is mutually exclusive with "vendor mode" and I don't think there are any plans to change that.
This is not true. If you pass -mod=vendor, or place it in $GOFLAGS, go will build something outside of GOPATH, in module mode, using the vendor directory exclusively. I wish it was the default, but only because it encourages people to not use vendor directories (which is a bad habit), not because it can't be worked around easily.
- calcifer 8y ago> in module mode, using the vendor directory exclusively But that's not what I'm asking. I want "go build" (with some flags) to use my fork (vendored if needed) for one library, and pick up all other dependencies from the module cache as usual. How do I that? Because this is already possible in a vendor-only world; I just edit the code in vendor.
- EdiX 8y agoYou check out the dependency you want to change and add a replace directive in go.mod. Either a temporary one to a file system path or a permanent one to a forked repository.
- candiodari 8y agoWhy are vendor directories a bad habit ? There just shouldn't be any GOPATH at all as far as I'm concerned. Look in /usr/include. There you can see what's wrong with GOPATH, 5 years in the future. Now try installing 2 different versions of libraries. I'll wait.
- EdiX 8y ago> Why are vendor directories a bad habit ? They aren't, not having them is.