1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 03:47:04 +00:00
Former-commit-id: 5ade70e6133406c8bbb4ecef36541fdd0d857f6f
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-12-21 14:42:39 +02:00
parent 67341251b8
commit 5cbc3d6827
4 changed files with 61 additions and 5 deletions

View File

@@ -45,6 +45,26 @@ func suffix(s string, suffix string) string {
return s
}
func splitMethod(methodMany string) []string {
methodMany = strings.Trim(methodMany, " ")
return strings.Split(methodMany, " ")
}
func splitPath(pathMany string) (paths []string) {
pathMany = strings.Trim(pathMany, " ")
pathsWithoutSlashFromFirstAndSoOn := strings.Split(pathMany, " /")
for _, path := range pathsWithoutSlashFromFirstAndSoOn {
if path == "" {
continue
}
if path[0] != '/' {
path = "/" + path
}
paths = append(paths, path)
}
return
}
func joinPath(path1 string, path2 string) string {
return path.Join(path1, path2)
}