From f1dfde81cec875647834beebdeeee1dd02498ae0 Mon Sep 17 00:00:00 2001 From: Mike Cohen Date: Tue, 10 Mar 2026 10:33:52 +1000 Subject: [PATCH] Bugfix: Use %v to convert to string It is a more generic format specifier. --- arg_parser/parser.go | 2 +- functions/functions.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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)