mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-19 20:26:26 +08:00
13 lines
252 B
Go
13 lines
252 B
Go
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
|
|
}
|