mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-08 00:40:26 +08:00
feat: flow design & page query refactor
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"mayfly-go/pkg/utils/collx"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/may-fly/cast"
|
||||
)
|
||||
|
||||
func TestTemplateParse(t *testing.T) {
|
||||
@@ -20,6 +22,14 @@ func TestTemplateParse(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
num1 := 12
|
||||
num2 := 12
|
||||
num3 := 2
|
||||
templ2 := "{{ eq .num1 121 }}"
|
||||
re, err := TemplateParse(templ2, collx.M{"num1": num1, "num2": num2, "num3": num3})
|
||||
|
||||
fmt.Println(err, cast.ToBool(re))
|
||||
|
||||
res, _ := TemplateParse(tmpl, vars)
|
||||
res2 := strings.TrimSpace(res)
|
||||
fmt.Println(res2)
|
||||
|
||||
Reference in New Issue
Block a user