fix go race bug
This commit is contained in:
parent
3367f427b4
commit
53009f2466
|
@ -29,8 +29,8 @@ func (w *GatedWriter) Flush() {
|
|||
}
|
||||
|
||||
func (w *GatedWriter) Write(p []byte) (n int, err error) {
|
||||
w.lock.RLock()
|
||||
defer w.lock.RUnlock()
|
||||
w.lock.Lock()
|
||||
defer w.lock.Unlock()
|
||||
|
||||
if w.flush {
|
||||
return w.Writer.Write(p)
|
||||
|
|
Loading…
Reference in New Issue