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) } diff --git a/src/path/filepath/path_unix.go b/src/path/filepath/path_unix.go index dddcac0a5c..d77ff24cdc 100644 --- a/src/path/filepath/path_unix.go +++ b/src/path/filepath/path_unix.go @@ -21,7 +21,8 @@ func volumeNameLen(path string) int { // HasPrefix exists for historical compatibility and should not be used. // -// Deprecated: Use strings.HasPrefix instead. +// 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) } diff --git a/src/path/filepath/path_windows.go b/src/path/filepath/path_windows.go index 359703de26..0d8b62015c 100644 --- a/src/path/filepath/path_windows.go +++ b/src/path/filepath/path_windows.go @@ -65,6 +65,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 { if strings.HasPrefix(p, prefix) { return true