From 35e794701ad2cff365ef6799d47c8d0d1f25c1dc Mon Sep 17 00:00:00 2001 From: Celestino Amoroso Date: Wed, 15 May 2024 22:03:03 +0200 Subject: [PATCH] func-string.go: commented out the param count check --- func-string.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/func-string.go b/func-string.go index d86d5de..c110e3e 100644 --- a/func-string.go +++ b/func-string.go @@ -33,9 +33,9 @@ func doJoinStr(funcName string, sep string, it Iterator) (result any, err error) } func joinStrFunc(ctx ExprContext, name string, args []any) (result any, err error) { - if len(args) < 1 { - return nil, errMissingRequiredParameter(name, paramSeparator) - } +// if len(args) < 1 { +// return nil, errMissingRequiredParameter(name, paramSeparator) +// } if sep, ok := args[0].(string); ok { if len(args) == 1 { result = "" @@ -62,9 +62,9 @@ func subStrFunc(ctx ExprContext, name string, args []any) (result any, err error var source string var ok bool - if len(args) < 1 { - return nil, errMissingRequiredParameter(name, paramSource) - } +// if len(args) < 1 { +// return nil, errMissingRequiredParameter(name, paramSource) +// } if source, ok = args[0].(string); !ok { return nil, errWrongParamType(name, paramSource, typeString, args[0]) } @@ -93,9 +93,9 @@ func trimStrFunc(ctx ExprContext, name string, args []any) (result any, err erro var source string var ok bool - if len(args) < 1 { - return nil, errMissingRequiredParameter(name, paramSource) - } +// if len(args) < 1 { +// return nil, errMissingRequiredParameter(name, paramSource) +// } if source, ok = args[0].(string); !ok { return nil, errWrongParamType(name, paramSource, typeString, args[0]) } @@ -108,9 +108,9 @@ func startsWithStrFunc(ctx ExprContext, name string, args []any) (result any, er var ok bool result = false - if len(args) < 1 { - return result, errMissingRequiredParameter(name, paramSource) - } +// if len(args) < 1 { +// return result, errMissingRequiredParameter(name, paramSource) +// } if source, ok = args[0].(string); !ok { return result, errWrongParamType(name, paramSource, typeString, args[0]) } @@ -133,9 +133,9 @@ func endsWithStrFunc(ctx ExprContext, name string, args []any) (result any, err var ok bool result = false - if len(args) < 1 { - return result, errMissingRequiredParameter(name, paramSource) - } +// if len(args) < 1 { +// return result, errMissingRequiredParameter(name, paramSource) +// } if source, ok = args[0].(string); !ok { return result, errWrongParamType(name, paramSource, typeString, args[0]) } @@ -159,9 +159,9 @@ func splitStrFunc(ctx ExprContext, name string, args []any) (result any, err err var parts []string var ok bool - if len(args) < 1 { - return result, errMissingRequiredParameter(name, paramSource) - } +// if len(args) < 1 { +// return result, errMissingRequiredParameter(name, paramSource) +// } if source, ok = args[0].(string); !ok { return result, errWrongParamType(name, paramSource, typeString, args[0]) }