diff --git a/src/text/template/funcs.go b/src/text/template/funcs.go index 7d63cf8b7bb6db..e256b7c649d848 100644 --- a/src/text/template/funcs.go +++ b/src/text/template/funcs.go @@ -487,7 +487,7 @@ func eq(arg1 reflect.Value, arg2 ...reflect.Value) (bool, error) { truth = arg.Int() >= 0 && arg1.Uint() == uint64(arg.Int()) default: if arg1.IsValid() && arg.IsValid() { - return false, errBadComparison + return false, fmt.Errorf("incompatible types for comparison: %v and %v", arg1.Type(), arg.Type()) } } } else { @@ -553,7 +553,7 @@ func lt(arg1, arg2 reflect.Value) (bool, error) { case k1 == uintKind && k2 == intKind: truth = arg2.Int() >= 0 && arg1.Uint() < uint64(arg2.Int()) default: - return false, errBadComparison + return false, fmt.Errorf("incompatible types for comparison: %v and %v", arg1.Type(), arg2.Type()) } } else { switch k1 {