You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HasPrefix exists for historical compatibility and should not be used.
We should switch this to use the "Deprecated:" tag so that tools can flag new uses of this.
As it is currently implemented, it is misleading because it only does strings.HasPrefix and does not actually match on patch segments. Thus, the following reports true, which is surprising:
filepath.HasPrefix("/home/userwrongdir/abc", "/home/user") // This reports true
The documentation for
filepath.HasPrefix
says:We should switch this to use the "Deprecated:" tag so that tools can flag new uses of this.
As it is currently implemented, it is misleading because it only does
strings.HasPrefix
and does not actually match on patch segments. Thus, the following reports true, which is surprising:\cc @neild
The text was updated successfully, but these errors were encountered: