]> Cypherpunks repositories - gostls13.git/commitdiff
log/slog: make hex a const
authorJes Cok <xigua67damn@gmail.com>
Sat, 11 Nov 2023 01:33:17 +0000 (01:33 +0000)
committerJonathan Amsterdam <jba@google.com>
Fri, 17 Nov 2023 16:18:11 +0000 (16:18 +0000)
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 <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/log/slog/json_handler.go

index c3b4882f414064989807f703531e02ff52e30032..da3eae1a8ec0d35bd35548f794f1f22d4d3bc7c8 100644 (file)
@@ -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.
 //