1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 20:07:04 +00:00

make macros even faster and smart catch common :string and do not execute anything at all if not really needed, more clean code as well

Former-commit-id: 589c23d1f92cf36b7677dfe78b60d51252c979fb
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-09-28 05:34:35 +03:00
parent 972dff8729
commit bf880033cd
4 changed files with 87 additions and 35 deletions

View File

@@ -10,7 +10,7 @@ import (
var (
// String type
// Allows anything (single path segment, as everything except the `Path`).
String = NewMacro("string", "", true, false, nil). // if nil allows everything.
String = NewMacro("string", "", true, false, nil).
RegisterFunc("regexp", func(expr string) func(string) bool {
return MustRegexp(expr)
}).