]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal: use pathpkg name more
authorcuishuang <imcusg@gmail.com>
Thu, 21 Nov 2024 09:14:21 +0000 (17:14 +0800)
committerGopher Robot <gobot@golang.org>
Sat, 15 Feb 2025 03:35:50 +0000 (19:35 -0800)
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>
src/cmd/go/internal/modfetch/proxy.go
src/cmd/go/internal/modload/load.go

index e0efb097ecdda9ee27f71c673258ab9f022f1a71..896f310bdf77ca4c7a0fec561b13a467072e9218 100644 (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
                        }
 
index 12dd9425f6596265c6d012a4443cf36f2d8e4c5c..1a3a4b5a694493c9ec780374b215706f008e76d3 100644 (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 {