aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2019-06-10 15:35:21 -0400
committerBryan C. Mills <bcmills@google.com>2019-06-10 20:32:02 +0000
commit39f7561e1b38e46d24b62e7dcc772ba87f8a802b (patch)
treefb8da91c448d6f02f85647b498ab79e5d7f41f84 /src
parent2d75c332cca28678ff61d9f7cd58a82acb75e197 (diff)
downloadgo-39f7561e1b38e46d24b62e7dcc772ba87f8a802b.tar.xz
cmd/go/internal/load: remove unused hasSubdir function
No references to this function remain; remove it to avoid confusion and reduce build overhead. The last reference was removed in CL 167748. Change-Id: I9d023c5d8904800edd3898fed79aa9f824dfb46a Reviewed-on: https://go-review.googlesource.com/c/go/+/181548 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/go/internal/load/path.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/cmd/go/internal/load/path.go b/src/cmd/go/internal/load/path.go
index 0211b284a4..584cdff891 100644
--- a/src/cmd/go/internal/load/path.go
+++ b/src/cmd/go/internal/load/path.go
@@ -6,32 +6,8 @@ package load
import (
"path/filepath"
- "strings"
)
-// hasSubdir reports whether dir is a subdirectory of
-// (possibly multiple levels below) root.
-// If so, it sets rel to the path fragment that must be
-// appended to root to reach dir.
-func hasSubdir(root, dir string) (rel string, ok bool) {
- if p, err := filepath.EvalSymlinks(root); err == nil {
- root = p
- }
- if p, err := filepath.EvalSymlinks(dir); err == nil {
- dir = p
- }
- const sep = string(filepath.Separator)
- root = filepath.Clean(root)
- if !strings.HasSuffix(root, sep) {
- root += sep
- }
- dir = filepath.Clean(dir)
- if !strings.HasPrefix(dir, root) {
- return "", false
- }
- return filepath.ToSlash(dir[len(root):]), true
-}
-
// expandPath returns the symlink-expanded form of path.
func expandPath(p string) string {
x, err := filepath.EvalSymlinks(p)