From 1106512db54fc2736c7a9a67dd553fc9e1fca742 Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Fri, 16 Dec 2016 13:35:51 -0800 Subject: path/filepath: deprecate HasPrefix Use the new "Deprecated:" syntax for all instances of HasPrefix. This is a follow-up to http://golang.org/cl/28413 which only modified path_unix.go. In this CL, we avoid mentioning that strings.HasPrefix should be used since that function is still subtly wrong in security applications. See http://golang.org/cl/5712045 for more information. Fixes #18355 Change-Id: I0d0306152cd0b0ea5110774c2c78117515b9f5cd Reviewed-on: https://go-review.googlesource.com/34554 Run-TryBot: Joe Tsai TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/path/filepath/path_plan9.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/path/filepath/path_plan9.go') diff --git a/src/path/filepath/path_plan9.go b/src/path/filepath/path_plan9.go index 60d46d9d42..ec792fc831 100644 --- a/src/path/filepath/path_plan9.go +++ b/src/path/filepath/path_plan9.go @@ -18,6 +18,9 @@ func volumeNameLen(path string) int { } // HasPrefix exists for historical compatibility and should not be used. +// +// Deprecated: HasPrefix does not respect path boundaries and +// does not ignore case when required. func HasPrefix(p, prefix string) bool { return strings.HasPrefix(p, prefix) } -- cgit v1.3-5-g9baa