I am using a mono repo and I download certain tools under the project tree (istio). Running go get -u
or go mod tidy
causes the main go.mod
to get updated with irrelevant deps.
How do I exclude certain src subpaths for consideration.
Note:
This does not do the trick as the subdirectories I want to exclude do have go files in them.
I think your two main options are:
A go.mod in a directory will cause that directory and all of its subdirectories to be excluded from the top-level Go module.
Use a leading underscore as Peter suggested, or a leading .
.
If neither of those are appropriate, please add a comment explaining why, ideally including an error message or some other set of details about what happened when you tried.