this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

pkg/path: remove osInfo.HasPrefix

We seem to have imported this deprecated API from Go back in 2020,
when that was entirely unnecessary at the time.
We don't have any tests nor documentation for it.

The good news is that we never exported any of the OS types in Go,
nor did we expose a HasPrefix func for CUE importers
like we did with IsAbs and others.

Hence, I assume this is an entirely backwards compatible change.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I2a23d4aa7d88678ae922d579b9f68a21c6d60f72
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1230077
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

-28
-1
pkg/path/os.go
··· 41 41 splitList(path string) []string 42 42 volumeNameLen(path string) int 43 43 IsAbs(path string) (b bool) 44 - HasPrefix(p, prefix string) bool 45 44 join(elem []string) string 46 45 sameWord(a, b string) bool 47 46 }
-8
pkg/path/path_nix.go
··· 44 44 return 0 45 45 } 46 46 47 - // HasPrefix exists for historical compatibility and should not be used. 48 - // 49 - // Deprecated: HasPrefix does not respect path boundaries and 50 - // does not ignore case when required. 51 - func (o unixInfo) HasPrefix(p, prefix string) bool { 52 - return strings.HasPrefix(p, prefix) 53 - } 54 - 55 47 func (o unixInfo) splitList(path string) []string { 56 48 if path == "" { 57 49 return []string{}
-8
pkg/path/path_p9.go
··· 42 42 return 0 43 43 } 44 44 45 - // HasPrefix exists for historical compatibility and should not be used. 46 - // 47 - // Deprecated: HasPrefix does not respect path boundaries and 48 - // does not ignore case when required. 49 - func (o plan9Info) HasPrefix(p, prefix string) bool { 50 - return strings.HasPrefix(p, prefix) 51 - } 52 - 53 45 func (o plan9Info) splitList(path string) []string { 54 46 if path == "" { 55 47 return []string{}
-11
pkg/path/path_win.go
··· 116 116 return 0 117 117 } 118 118 119 - // HasPrefix exists for historical compatibility and should not be used. 120 - // 121 - // Deprecated: HasPrefix does not respect path boundaries and 122 - // does not ignore case when required. 123 - func (os windowsInfo) HasPrefix(p, prefix string) bool { 124 - if strings.HasPrefix(p, prefix) { 125 - return true 126 - } 127 - return strings.HasPrefix(strings.ToLower(p), strings.ToLower(prefix)) 128 - } 129 - 130 119 func (os windowsInfo) splitList(path string) []string { 131 120 // The same implementation is used in LookPath in os/exec; 132 121 // consider changing os/exec when changing this.