From b3443b3d0c537c7c82b5df55a0a9d91288d1d56a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 5 Nov 2017 10:20:30 +0100 Subject: [PATCH] Revert "i18n: Prevent data race in lang code handling" This reverts commit c97216e4f0f3021b12cd3803e512393be569c886. --- i18n/i18n.go | 2 -- i18n/translationProvider.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/i18n/i18n.go b/i18n/i18n.go index 6cc3d0b33..73417fb32 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 556ee7a92..663a8dd5e 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.