diff --git a/arg_parser/parser.go b/arg_parser/parser.go index c99f9dd..e7cbe74 100644 --- a/arg_parser/parser.go +++ b/arg_parser/parser.go @@ -217,7 +217,7 @@ func stringParser(ctx context.Context, scope types.Scope, return fmt.Sprintf("%v", arg), nil default: - return fmt.Sprintf("%s", arg), nil + return fmt.Sprintf("%v", arg), nil } } diff --git a/functions/functions.go b/functions/functions.go index 57d87a5..4abf70d 100644 --- a/functions/functions.go +++ b/functions/functions.go @@ -194,11 +194,15 @@ func (self _EncodeFunction) Call( switch t := arg.String.(type) { case string: arg_string = t + case []byte: arg_string = string(t) + case error: + return t.Error() + case fmt.Stringer: - arg_string = fmt.Sprintf("%s", t) + arg_string = t.String() default: arg_string = fmt.Sprintf("%v", t)