commands: Fix data race in test

Note that this is a test fix only.
This commit is contained in:
Bjørn Erik Pedersen
2023-03-14 12:18:42 +01:00
parent f5eddf89bf
commit 0fbab7cbc5
6 changed files with 15 additions and 11 deletions

View File

@@ -415,7 +415,7 @@ func Deprecated(item, alternative string, err bool) {
DistinctErrorLog.Errorf("%s is deprecated and will be removed in Hugo %s. %s", item, hugo.CurrentVersion.Next().ReleaseVersion(), alternative)
} else {
var warnPanicMessage string
if !loggers.PanicOnWarning {
if !loggers.PanicOnWarning.Load() {
warnPanicMessage = "\n\nRe-run Hugo with the flag --panicOnWarning to get a better error message."
}
DistinctWarnLog.Warnf("%s is deprecated and will be removed in a future release. %s%s", item, alternative, warnPanicMessage)