Skip to content

Commit

Permalink
fix gotime MarshalJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
wzyonggege committed Jun 24, 2020
1 parent 19802b0 commit 064de99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gotime/gotime.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Time time.Time
func (g Time) MarshalJSON() ([]byte, error) {
// 判空
if time.Time(g).UnixNano() == (time.Time{}).UnixNano() {
return []byte(""), nil
return []byte("\"\""), nil
}
stamp := fmt.Sprintf("\"%s\"", g.Format(TT))
return []byte(stamp), nil
Expand Down

0 comments on commit 064de99

Please sign in to comment.