There was an error while loading. Please reload this page.
1 parent 51cd8d9 commit f47e169Copy full SHA for f47e169
1 file changed
jsend.go
@@ -119,7 +119,7 @@ type Response struct {
119
code int
120
sent bool
121
fields map[string]interface{}
122
- sync.Mutex
+ mu sync.Mutex
123
}
124
125
// Field method allows you to set custom response fields.
@@ -165,8 +165,8 @@ var errSentAlready = errors.New("jsend: sent already")
165
166
// Send encodes and writes buffered data to underlying http response object.
167
func (r *Response) Send() (int, error) {
168
- r.Lock()
169
- defer r.Unlock()
+ r.mu.Lock()
+ defer r.mu.Unlock()
170
171
if r.sent {
172
return 0, errSentAlready
0 commit comments