mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
commands: Fix data race in test
Note that this is a test fix only.
This commit is contained in:
@@ -65,10 +65,10 @@ func TestDistinctLoggerDoesNotLockOnWarningPanic(t *testing.T) {
|
||||
|
||||
// Set PanicOnWarning to true to reproduce issue 9380
|
||||
// Ensure global variable loggers.PanicOnWarning is reset to old value after test
|
||||
if loggers.PanicOnWarning == false {
|
||||
loggers.PanicOnWarning = true
|
||||
if !loggers.PanicOnWarning.Load() {
|
||||
loggers.PanicOnWarning.Store(true)
|
||||
defer func() {
|
||||
loggers.PanicOnWarning = false
|
||||
loggers.PanicOnWarning.Store(false)
|
||||
}()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user