1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 12:31:58 +00:00

20 days of unstoppable work. Waiting fo go 1.8, I didn't finish yet, some touches remains.

Former-commit-id: ed84f99c89f43fe5e980a8e6d0ee22c186f0e1b9
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-02-14 05:54:11 +02:00
parent 2b2a205e63
commit 244a59e055
108 changed files with 9016 additions and 7596 deletions

View File

@@ -0,0 +1,23 @@
package httprouter
func joinPathArguments(args ...interface{}) []interface{} {
arguments := args[0:]
for i, v := range arguments {
if arr, ok := v.([]string); ok {
if len(arr) > 0 {
interfaceArr := make([]interface{}, len(arr))
for j, sv := range arr {
interfaceArr[j] = sv
}
// replace the current slice
// with the first string element (always as interface{})
arguments[i] = interfaceArr[0]
// append the rest of them to the slice itself
// the range is not affected by these things in go,
// so we are safe to do it.
arguments = append(args, interfaceArr[1:]...)
}
}
}
return arguments
}