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)
pull/2828/head
Brad Fitzpatrick 3 years ago
parent a76c8eea58
commit a353fbd3b4

@ -139,3 +139,9 @@ func (ml *MemLogger) Logf(format string, args ...interface{}) {
ml.Buffer.WriteByte('\n')
}
}
func (ml *MemLogger) String() string {
ml.Lock()
defer ml.Unlock()
return ml.Buffer.String()
}

Loading…
Cancel
Save