1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-24 12:25:57 +00:00
Former-commit-id: 06ad874613c270383be5a7355cbb23a2dcf7a903
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-03-23 02:34:45 +02:00
parent 7e94befac8
commit 64ecc88195
4 changed files with 81 additions and 42 deletions

View File

@@ -47,6 +47,8 @@ func link(path string, mac _macros) iris.HandlerFunc {
if err != nil {
panic(err)
}
// println(tmpl.Params[0].Param.FailStatusCode)
// link the path, based on its template with a macro
// and return a new compiled macro or a list of iris handlers
// in order to be prepended on the original route or make a different function for that?
@@ -334,8 +336,8 @@ func TestMacros(t *testing.T) {
// when string macro is used:
addMacroFunc("string", "contains", macroFuncFrom(func(text string) _macrofn {
return func(paramValue string) bool {
println("from string:contains instead of any:string")
println("'" + text + "' vs '" + paramValue + "'")
// println("from string:contains instead of any:string")
// println("'" + text + "' vs '" + paramValue + "'")
return strings.Contains(paramValue, text)
}