mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-22 17:42:14 +08:00
WriteJSON check response write error
This commit is contained in:
parent
d6b2c13b18
commit
6fecbdff2a
@ -67,7 +67,10 @@ func WriteJSON(w http.ResponseWriter, obj interface{}) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
w.Write(jsonBytes)
|
||||
_, err = w.Write(jsonBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user