-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable HTMLEscape in reflect JSON encoder (#704)
Fixes #700. Zap's custom JSON encoder does not escape HTML, so make encoding by the reflect-based JSON encoder work the same way.
- Loading branch information
Showing
2 changed files
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1c5a13c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
root@MPSYUN-W1-000057:/usr/mpsyun# go get -u go.uber.org/zap
go.uber.org/zap/zapcore
/root/src/go.uber.org/zap/zapcore/json_encoder.go:142: enc.reflectEnc.SetEscapeHTML undefined (type *json.Encoder has no field or method SetEscapeHTML)
it happened,after your commit.How to solve this?
1c5a13c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now call
json.SetEscapeHTML
which was introduced in Go 1.7.Please upgrade to a newer version of Go (the latest release is 1.12).