blob: c35791cb6f6964e5c7e13fbe421b3ad8dee43a3e (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package resolve
import (
"io/fs"
"strings"
)
func treeFSValidPath(name string) bool {
return name == "." || fs.ValidPath(name)
}
func treeFSSplitPath(name string) [][]byte {
if name == "." {
return nil
}
parts := strings.Split(name, "/")
out := make([][]byte, len(parts))
for i, part := range parts {
out[i] = []byte(part)
}
return out
}
func treeFSPathError(op treeFSOp, path string, err error) error {
return &fs.PathError{Op: op.pathErrorOp(), Path: path, Err: err}
}
|