From: Bjørn Erik Pedersen Date: Sun, 5 Nov 2017 09:20:30 +0000 (+0100) Subject: Revert "i18n: Prevent data race in lang code handling" X-Git-Tag: v0.31~30 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b3443b3d0c537c7c82b5df55a0a9d91288d1d56a;p=brevno-suite%2Fhugo Revert "i18n: Prevent data race in lang code handling" This reverts commit c97216e4f0f3021b12cd3803e512393be569c886. --- diff --git a/i18n/i18n.go b/i18n/i18n.go index 6cc3d0b3..73417fb3 100644 --- a/i18n/i18n.go +++ b/i18n/i18n.go @@ -68,9 +68,7 @@ func (t Translator) initFuncs(bndl *bundle.Bundle) { currentLang := lang t.translateFuncs[currentLang] = func(translationID string, args ...interface{}) string { - tpMu.RLock() tFunc, err := bndl.Tfunc(currentLang) - tpMu.RUnlock() if err != nil { jww.WARN.Printf("could not load translations for language %q (%s), will use default content language.\n", lang, err) } diff --git a/i18n/translationProvider.go b/i18n/translationProvider.go index 556ee7a9..663a8dd5 100644 --- a/i18n/translationProvider.go +++ b/i18n/translationProvider.go @@ -25,7 +25,7 @@ import ( // Unfortunately this needs to be global, see // https://github.com/nicksnyder/go-i18n/issues/82 -var tpMu sync.RWMutex +var tpMu sync.Mutex // TranslationProvider provides translation handling, i.e. loading // of bundles etc.