-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilepath.go
83 lines (63 loc) · 1.5 KB
/
filepath.go
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package fil
import (
"os"
"path/filepath"
)
const (
Separator = os.PathSeparator
ListSeparator = os.PathListSeparator
)
func Abs(path string) (string, error) {
return filepath.Abs(path)
}
func Base(path string) string {
return filepath.Base(path)
}
func Clean(path string) string {
return filepath.Clean(path)
}
func Dir(path string) string {
return filepath.Dir(path)
}
func EvalSymlinks(path string) (string, error) {
return filepath.EvalSymlinks(path)
}
func Ext(path string) string {
return filepath.Ext(path)
}
func FromSlash(path string) string {
return filepath.FromSlash(path)
}
func Glob(pattern string) (matches []string, err error) {
return filepath.Glob(pattern)
}
func HasPrefix(p, prefix string) bool {
return filepath.HasPrefix(p, prefix)
}
func IsAbs(path string) bool {
return filepath.IsAbs(path)
}
func Join(elem ...string) string {
return filepath.Join(elem...)
}
func Match(pattern, name string) (matched bool, err error) {
return filepath.Match(pattern, name)
}
func Rel(basepath, targpath string) (string, error) {
return filepath.Rel(basepath, targpath)
}
func Split(path string) (dir, file string) {
return filepath.Split(path)
}
func SplitList(path string) []string {
return filepath.SplitList(path)
}
func ToSlash(path string) string {
return filepath.ToSlash(path)
}
func VolumeName(path string) (v string) {
return filepath.VolumeName(path)
}
func Walk(root string, walkFn filepath.WalkFunc) error {
return filepath.Walk(root, walkFn)
}