tstest: make MemLogger.String acquire its mutex
Updates #2781 (might even fix it, but its real issue is that SetPrivateKey starts a ReSTUN goroutines which then logs, and that bug and data race existed prior to MemLogger existing)
This commit is contained in:
@@ -139,3 +139,9 @@ func (ml *MemLogger) Logf(format string, args ...interface{}) {
|
|||||||
ml.Buffer.WriteByte('\n')
|
ml.Buffer.WriteByte('\n')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ml *MemLogger) String() string {
|
||||||
|
ml.Lock()
|
||||||
|
defer ml.Unlock()
|
||||||
|
return ml.Buffer.String()
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user