feat: get accounts by path

This commit is contained in:
Noah Hsu
2022-06-09 23:05:27 +08:00
parent e1a2ed0436
commit 164dab49ac
4 changed files with 64 additions and 8 deletions

12
pkg/utils/path.go Normal file
View 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
}