]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: refactor pathInModuleCache
authorBryan C. Mills <bcmills@google.com>
Tue, 1 Sep 2020 04:34:03 +0000 (00:34 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 9 Sep 2020 22:39:28 +0000 (22:39 +0000)
commitaa476ba6f43ebc4e7ddb6599a7ad35d9fbf1ec6d
tree9c62dea31b0a95147040a8084f51765feefc0791
parent564b350c08a1906e8f6a876fef4cca71f6516d4c
cmd/go/internal/modload: refactor pathInModuleCache

I found the control flow of this function a bit tricky to reason about
due to nesting and interaction between conditions and iteration. This
change factors out a helper function that can return early instead of
mixing conditionals and 'continue' statements.

Also remove the (unused) ModuleUsedDirectly function.

For #36460

Change-Id: I60a2a5a1b32989e5a17a14e1a8c858b280cda8f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/251998
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/internal/modload/load.go