fix data race

master
kevin 4 years ago
parent ba7851795b
commit 40230d79e7

@ -33,10 +33,10 @@ func captureOutput(f func()) string {
writer := new(mockWriter) writer := new(mockWriter)
infoLog = writer infoLog = writer
prevLevel := logLevel prevLevel := atomic.LoadUint32(&logLevel)
logLevel = InfoLevel SetLevel(InfoLevel)
f() f()
logLevel = prevLevel SetLevel(prevLevel)
return writer.builder.String() return writer.builder.String()
} }

Loading…
Cancel
Save