From 6202a67201234710859d7b0e4c75a85a428fd520 Mon Sep 17 00:00:00 2001 From: Dan Hudlow Date: Fri, 6 Dec 2024 02:00:56 -0600 Subject: [PATCH] improve debug output to properly quote byte strings (#1088) --- common/debug/debug.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/debug/debug.go b/common/debug/debug.go index 25d2e3d7..75f5f0d6 100644 --- a/common/debug/debug.go +++ b/common/debug/debug.go @@ -257,7 +257,7 @@ func formatLiteral(c ref.Val) string { case types.Bool: return fmt.Sprintf("%t", v) case types.Bytes: - return fmt.Sprintf("b\"%s\"", string(v)) + return fmt.Sprintf("b%s", strconv.Quote(string(v))) case types.Double: return fmt.Sprintf("%v", float64(v)) case types.Int: