15 lines
203 B
Go
15 lines
203 B
Go
package tower
|
|
|
|
import "strings"
|
|
|
|
func normalizePath(path string) string {
|
|
if path == "" {
|
|
return "/"
|
|
}
|
|
|
|
path = strings.TrimLeft(path, "/")
|
|
path = strings.TrimRight(path, "/")
|
|
|
|
return "/" + path
|
|
}
|