File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 13
13
floatType = reflect .TypeOf (float64 (0 ))
14
14
stringType = reflect .TypeOf ("" )
15
15
arrayType = reflect .TypeOf ([]interface {}{})
16
- mapType = reflect .TypeOf (map [interface {} ]interface {}{})
16
+ mapType = reflect .TypeOf (map [string ]interface {}{})
17
17
interfaceType = reflect .TypeOf (new (interface {})).Elem ()
18
18
)
19
19
Original file line number Diff line number Diff line change @@ -637,6 +637,10 @@ func TestExpr(t *testing.T) {
637
637
`1 + 2 + Three` ,
638
638
6 ,
639
639
},
640
+ {
641
+ `MapArg({foo: "bar"})` ,
642
+ "bar" ,
643
+ },
640
644
}
641
645
642
646
for _ , tt := range tests {
@@ -703,6 +707,10 @@ func (*mockEnv) Duration(s string) time.Duration {
703
707
return d
704
708
}
705
709
710
+ func (* mockEnv ) MapArg (m map [string ]interface {}) string {
711
+ return m ["foo" ].(string )
712
+ }
713
+
706
714
type ticket struct {
707
715
Price int
708
716
}
You can’t perform that action at this time.
0 commit comments