mirror of
https://gitee.com/johng/gf
synced 2026-07-06 13:42:46 +08:00
change pointer receiver that implements interface MarshalJSON to struct receiver for all packages
This commit is contained in:
@ -185,7 +185,7 @@ func (err *Error) SetCode(code gcode.Code) {
|
||||
|
||||
// MarshalJSON implements the interface MarshalJSON for json.Marshal.
|
||||
// Note that do not use pointer as its receiver here.
|
||||
func (err *Error) MarshalJSON() ([]byte, error) {
|
||||
func (err Error) MarshalJSON() ([]byte, error) {
|
||||
return []byte(`"` + err.Error() + `"`), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user