1
0
mirror of https://github.com/golang/go synced 2024-09-28 18:14:29 -06:00

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.
This commit is contained in:
Jes Cok 2023-11-11 09:25:45 +08:00
parent 3188758653
commit 08712be2d4

View 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.
//