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