// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build unix || (js && wasm) || wasip1 package filepath import ( "bytes" ) // 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 []byte) bool { return bytes.HasPrefix(p, prefix) } func splitList(path []byte) [][]byte { if path == "" { return [][]byte{} } return bytes.Split(path, []byte{byte(ListSeparator)}) } func abs(path []byte) ([]byte, error) { return unixAbs(path) } func join(elem [][]byte) []byte { // If there's a bug here, fix the logic in ./path_plan9.go too. for i, e := range elem { if e != "" { return Clean(bytes.Join(elem[i:], []byte{byte(Separator)})) } } return "" } func sameWord(a, b []byte) bool { return a == b }