]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/toolchain: avoid importing modcmd
authorBryan C. Mills <bcmills@google.com>
Fri, 26 May 2023 18:48:22 +0000 (14:48 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 1 Jun 2023 15:54:37 +0000 (15:54 +0000)
commit0a87fdc06e9c4ae73b31cd08c26ed32c8a80923b
treef41234d266f0c09cb29fc72b9c010abeb3936e79
parent5f08963b2cbc90a287a4aef5cf8a3d6a3b221692
cmd/go/internal/toolchain: avoid importing modcmd

modcmd is a high-level command, but toolchain is a low-level building
block. A dependency from toolchain on modcmd makes it very difficult
to call from other lower-level packages without creating an import
cycle.

Instead, use modfetch.Download in place of modcmd.DownloadModule.

For #57001.

Change-Id: I9694706d7225b269f26dc68814894613a3329abb
Reviewed-on: https://go-review.googlesource.com/c/go/+/499316
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/internal/toolchain/toolchain.go