diff options
author | Nick Snyder <nickdsnyder@gmail.com> | 2020-09-29 07:10:47 +0300 |
---|---|---|
committer | Nick Snyder <nickdsnyder@gmail.com> | 2020-09-29 07:10:47 +0300 |
commit | b5d18987dcd811aa0cd6b15c62370109b377ec6f (patch) | |
tree | dbf8938daf293e99f2781e69c44ff2171dc3ed5c | |
parent | ba619d4d6908185c2e66904c74646d33a52517e9 (diff) |
fix testhtmlentities
-rw-r--r-- | v2/goi18n/marshal.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/v2/goi18n/marshal.go b/v2/goi18n/marshal.go index 751b698..a6cc762 100644 --- a/v2/goi18n/marshal.go +++ b/v2/goi18n/marshal.go @@ -49,7 +49,12 @@ func marshalValue(messageTemplates map[string]*i18n.MessageTemplate, sourceLangu func marshal(v interface{}, format string) ([]byte, error) { switch format { case "json": - return json.MarshalIndent(v, "", " ") + var buf bytes.Buffer + enc := json.NewEncoder(&buf) + enc.SetEscapeHTML(false) + enc.SetIndent("", " ") + err := enc.Encode(v) + return buf.Bytes(), err case "toml": var buf bytes.Buffer enc := toml.NewEncoder(&buf) |