mirror of
https://github.com/HChaZZY/alist.git
synced 2025-12-06 11:03:49 +08:00
feat: get accounts by path
This commit is contained in:
12
pkg/utils/path.go
Normal file
12
pkg/utils/path.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package utils
|
||||
|
||||
import "strings"
|
||||
|
||||
// StandardizationPath convert path like '/' '/root' '/a/b'
|
||||
func StandardizationPath(path string) string {
|
||||
path = strings.TrimSuffix(path, "/")
|
||||
if !strings.HasPrefix(path, "/") {
|
||||
path = "/" + path
|
||||
}
|
||||
return path
|
||||
}
|
||||
Reference in New Issue
Block a user