mirror of
https://github.com/golang/go
synced 2024-11-26 18:16:48 -07:00
encoding/json: declare hex as 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:
parent
ac64a3628b
commit
d2f06965e7
@ -245,7 +245,7 @@ func (e *MarshalerError) Error() string {
|
||||
// Unwrap returns the underlying error.
|
||||
func (e *MarshalerError) Unwrap() error { return e.Err }
|
||||
|
||||
var hex = "0123456789abcdef"
|
||||
const hex = "0123456789abcdef"
|
||||
|
||||
// An encodeState encodes JSON into a bytes.Buffer.
|
||||
type encodeState struct {
|
||||
|
Loading…
Reference in New Issue
Block a user