mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-14 18:30:02 +08:00
chore: refactor unit tests (#5041)
This commit is contained in:
@@ -177,8 +177,8 @@ func doMarshalJson(v any) ([]byte, error) {
|
||||
// why not use json.Marshal? https://github.com/golang/go/issues/28453
|
||||
// it change the behavior of json.Marshal, like & -> \u0026, < -> \u003c, > -> \u003e
|
||||
// which is not what we want in logic response
|
||||
buf := &bytes.Buffer{}
|
||||
enc := json.NewEncoder(buf)
|
||||
var buf bytes.Buffer
|
||||
enc := json.NewEncoder(&buf)
|
||||
enc.SetEscapeHTML(false)
|
||||
if err := enc.Encode(v); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user