Feat: adapt copy method for WebDAV

This commit is contained in:
HFO4
2019-12-20 11:59:09 +08:00
parent 9fdf2fe7ab
commit c1b02380ac
4 changed files with 32 additions and 81 deletions

View File

@ -15,6 +15,15 @@ func FillSlash(path string) string {
return path + "/"
}
// RemoveSlash 移除路径最后的`/`
// TODO 测试
func RemoveSlash(path string) string {
if len(path) > 1 {
return strings.TrimSuffix(path, "/")
}
return path
}
// SplitPath 分割路径为列表
func SplitPath(path string) []string {
if len(path) == 0 || path[0] != '/' {