Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I'm converting a large source tree which used vendoring in GOPATH world into a Go module. An issue I've encountered is that
These look like:
Where a warning line is printed for every symlinked directory in the repo.
These warnings make these 'go mod' commands unpleasant to use (you have to scroll through all the junk to see the relevant bits, if any, at the bottom).
None of the Go code is in symlinked directories. The symlinks are for other projects in other languages. For example, one use of symlinks is as a cheap way to share certain JS/CSS assets between multiple sub-projects.
Would it be possible to simply delete these warnings? Alternatively, could we remove the warning if the symlinked directory doesn't contain any Go code?
I tested this behavior in both Go 1.13.4 and tip (bf3ee57).
It looks like this warning was introduced in CL 46425, long before modules. It's emitted any time a pattern is expanded (
I don't think these warnings should be deleted entirely, but making them less spammy would be good. Not sure how to do that though. Checking for .go files in a symlinked directory is probably not enough, since the directory itself may not have any .go files, but it may have subdirectories that do. I think Kubernetes'
@jayconrod yeah, I've run into this in the past when doing things like
However, I think the spam is more of a problem with modules:
What about suppressing the warnings for
If they're not appropriate for
Given that folks can already explicitly prune out subdirectories using
As an alternative, would it make sense to do the
I explained above why I think it's reasonable to treat these differently, but if we have to treat them the same, then I'd err on the side of no spam.
We have a large monorepo with projects in several languages. Before it was all a single GOPATH with vendored source. I'm converting it to be a single module instead.
Adding empty go.mod files to a bunch of project directories just to suppress this warning is probably a nonstarter.
Currently, only sibling (or "cousin" or "cousin Nth removed") directories.
I didn't mind ignoring these warnings (or