commit be6482603ee8ac3516ae19ceebb35662f038b25e
parent bee521c68fa14ea76e2f442d7907be04bf50e3e6
Author: bep <bjorn.erik.pedersen@gmail.com>
Date: Sat, 2 May 2015 11:32:38 +0200
Disable faulty range validation in apply
Fixed #1098
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/tpl/template_funcs.go b/tpl/template_funcs.go
@@ -666,11 +666,12 @@ func applyFnToThis(fn, this reflect.Value, args ...interface{}) (reflect.Value,
num--
}
- if len(args) < num {
+ // TODO(bep) see #1098 - also see template_tests.go
+ /*if len(args) < num {
return reflect.ValueOf(nil), errors.New("Too few arguments")
} else if len(args) > num {
return reflect.ValueOf(nil), errors.New("Too many arguments")
- }
+ }*/
for i := 0; i < num; i++ {
if xt, targ := n[i].Type(), fn.Type().In(i); !xt.AssignableTo(targ) {
diff --git a/tpl/template_test.go b/tpl/template_test.go
@@ -18,11 +18,11 @@ func TestTplGoFuzzReports(t *testing.T) {
expectErr int
}{
// Issue #1089
- {"{{apply .C \"first\" }}", 2},
+ //{"{{apply .C \"first\" }}", 2},
// Issue #1090
{"{{ slicestr \"000000\" 10}}", 2},
// Issue #1091
- {"{{apply .C \"first\" 0 0 0}}", 2},
+ //{"{{apply .C \"first\" 0 0 0}}", 2},
{"{{seq 3e80}}", 2},
// Issue #1095
{"{{apply .C \"urlize\" " +