aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2022-11-09 17:49:44 -0800
committerDamien Neil <dneil@google.com>2022-11-16 23:17:58 +0000
commit6d0bf438e302afcb0db5422ea2da59d1995e08c1 (patch)
treeb931b814d4a959903ea32c37ec69d92fcb0ca7c5 /api
parentfd59c6cf8cb600f2911864948303016581abf016 (diff)
downloadgo-6d0bf438e302afcb0db5422ea2da59d1995e08c1.tar.xz
path/filepath: add IsLocal
IsLocal reports whether a path lexically refers to a location contained within the directory in which it is evaluated. It identifies paths that are absolute, escape a directory with ".." elements, and (on Windows) paths that reference reserved device names. For #56219. Change-Id: I35edfa3ce77b40b8e66f1fc8e0ff73cfd06f2313 Reviewed-on: https://go-review.googlesource.com/c/go/+/449239 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Joedian Reid <joedian@golang.org>
Diffstat (limited to 'api')
-rw-r--r--api/next/56219.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/api/next/56219.txt b/api/next/56219.txt
new file mode 100644
index 0000000000..6379c06a2e
--- /dev/null
+++ b/api/next/56219.txt
@@ -0,0 +1 @@
+pkg path/filepath, func IsLocal(string) bool #56219