Skip to content

Commit

Permalink
add mutex lock/unlock on Printer#WriteTo, rel: kataras/iris#1160
Browse files Browse the repository at this point in the history
  • Loading branch information
kataras committed Jan 3, 2019
1 parent a9733b5 commit ea782b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ func (p *Printer) Store(v interface{}, appendNewLine bool) error {
//
// Returns this WriteTo's result information such as error, written.
func (p *Printer) WriteTo(v interface{}, w io.Writer, appendNewLine bool) ([]byte, error) {
p.mu.Lock()
defer p.mu.Unlock()

var marshaler Marshaler

// check if implements the Marshaled
Expand Down

0 comments on commit ea782b3

Please sign in to comment.