From c50e7ded1f058ff934dd6eec463a00e735b31c82 Mon Sep 17 00:00:00 2001 From: Jes Cok Date: Sat, 11 Nov 2023 01:33:17 +0000 Subject: [PATCH] log/slog: make hex a const hex is in fact immutable, declare it as a const to avoid accidental modification, also for consistency with other packages. Change-Id: I88a6fed34d27ac57a0332dc7a27d3bf2ba0d6272 GitHub-Last-Rev: 08712be2d4e3951e87b4a4f410ba424d12a320e3 GitHub-Pull-Request: golang/go#64069 Reviewed-on: https://go-review.googlesource.com/c/go/+/541518 TryBot-Result: Gopher Robot Reviewed-by: Jonathan Amsterdam Reviewed-by: Bryan Mills LUCI-TryBot-Result: Go LUCI --- src/log/slog/json_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/log/slog/json_handler.go b/src/log/slog/json_handler.go index c3b4882f41..da3eae1a8e 100644 --- a/src/log/slog/json_handler.go +++ b/src/log/slog/json_handler.go @@ -226,7 +226,7 @@ func appendEscapedJSONString(buf []byte, s string) []byte { return buf } -var hex = "0123456789abcdef" +const hex = "0123456789abcdef" // Copied from encoding/json/tables.go. // -- 2.50.0