Skip to content

Commit

Permalink
Unexpose mutex in Response
Browse files Browse the repository at this point in the history
  • Loading branch information
glkz committed Oct 11, 2015
1 parent 51cd8d9 commit f47e169
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jsend.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ type Response struct {
code int
sent bool
fields map[string]interface{}
sync.Mutex
mu sync.Mutex
}

// Field method allows you to set custom response fields.
Expand Down Expand Up @@ -165,8 +165,8 @@ var errSentAlready = errors.New("jsend: sent already")

// Send encodes and writes buffered data to underlying http response object.
func (r *Response) Send() (int, error) {
r.Lock()
defer r.Unlock()
r.mu.Lock()
defer r.mu.Unlock()

if r.sent {
return 0, errSentAlready
Expand Down

0 comments on commit f47e169

Please sign in to comment.