Skip to content

Commit 312ae16

Browse files
author
Will Buckner
committed
cmd/go: fix regression allowing '...' wildcard as last element in go get
1 parent 26b98e1 commit 312ae16

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/cmd/go/internal/get/path.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ func checkPath(path string, fileName bool) error {
4141
if path == "" {
4242
return fmt.Errorf("empty string")
4343
}
44-
if strings.Contains(path, "..") {
45-
return fmt.Errorf("double dot")
46-
}
4744
if strings.Contains(path, "//") {
4845
return fmt.Errorf("double slash")
4946
}
@@ -59,8 +56,10 @@ func checkPath(path string, fileName bool) error {
5956
elemStart = i + 1
6057
}
6158
}
62-
if err := checkElem(path[elemStart:], fileName); err != nil {
63-
return err
59+
if path[elemStart:] != "..." {
60+
if err := checkElem(path[elemStart:], fileName); err != nil {
61+
return err
62+
}
6463
}
6564
return nil
6665
}

0 commit comments

Comments
 (0)