cmd/go/internal: use pathpkg name more

The package "path" is already imported under the name pathpkg and used
many times in these files. It's not worth it to also make it available
under the name path, so keep using pathpkg.

Change-Id: I7f8fa7a11de338b9a7c0f58a48d5af68b5639cfe
Reviewed-on: https://go-review.googlesource.com/c/go/+/630475
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
cuishuang 2024-11-21 17:14:21 +08:00 committed by Gopher Robot
parent 1ce87bea47
commit 67903012f7
2 changed files with 2 additions and 4 deletions

View file

@ -12,7 +12,6 @@ import (
"io"
"io/fs"
"net/url"
"path"
pathpkg "path"
"path/filepath"
"strings"
@ -98,7 +97,7 @@ func proxyList() ([]proxySpec, error) {
// Single-word tokens are reserved for built-in behaviors, and anything
// containing the string ":/" or matching an absolute file path must be a
// complete URL. For all other paths, implicitly add "https://".
if strings.ContainsAny(url, ".:/") && !strings.Contains(url, ":/") && !filepath.IsAbs(url) && !path.IsAbs(url) {
if strings.ContainsAny(url, ".:/") && !strings.Contains(url, ":/") && !filepath.IsAbs(url) && !pathpkg.IsAbs(url) {
url = "https://" + url
}

View file

@ -103,7 +103,6 @@ import (
"io/fs"
"maps"
"os"
"path"
pathpkg "path"
"path/filepath"
"runtime"
@ -717,7 +716,7 @@ func pathInModuleCache(ctx context.Context, dir string, rs *Requirements) string
return "", false
}
return path.Join(m.Path, filepath.ToSlash(sub)), true
return pathpkg.Join(m.Path, filepath.ToSlash(sub)), true
}
if rs.pruning == pruned {