Change-Id: I9d39984b6b15d415189592b592de471f50b43d0b
Reviewed-on: https://go-review.googlesource.com/c/go/+/618495
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
}
modRoot := findModuleRoot(absDir)
- found := false
- for _, mainModuleRoot := range modRoots {
- if mainModuleRoot == modRoot {
- found = true
- break
- }
- }
- if !found && search.InDir(absDir, cfg.GOROOTsrc) == "" && pathInModuleCache(ctx, absDir, rs) == "" {
+ if !slices.Contains(modRoots, modRoot) && search.InDir(absDir, cfg.GOROOTsrc) == "" && pathInModuleCache(ctx, absDir, rs) == "" {
m.Dirs = []string{}
scope := "main module or its selected dependencies"
if inWorkspaceMode() {