From: Jes Cok Date: Sat, 11 Nov 2023 01:33:17 +0000 (+0000) Subject: log/slog: make hex a const X-Git-Tag: go1.22rc1~283 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c50e7ded1f058ff934dd6eec463a00e735b31c82;p=gostls13.git 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 --- 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. //