From c62dae3c6ba3784ca2868812c87876f00599b2c7 Mon Sep 17 00:00:00 2001 From: Leonel Quinteros Date: Sun, 8 Apr 2018 17:37:29 -0300 Subject: [PATCH] Fix crash during Configure. Fixes #24 --- gotext.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gotext.go b/gotext.go index 0c602b8..b25413c 100644 --- a/gotext.go +++ b/gotext.go @@ -67,6 +67,7 @@ func loadStorage(force bool) { if _, ok := globalConfig.storage.Domains[globalConfig.domain]; !ok || force { globalConfig.storage.AddDomain(globalConfig.domain) } + globalConfig.storage.SetDomain(globalConfig.domain) globalConfig.Unlock() } @@ -143,12 +144,9 @@ func SetLibrary(lib string) { // as using each setter will introduce a I/O overhead because the Translation file will be loaded after each set. func Configure(lib, lang, dom string) { globalConfig.Lock() - globalConfig.library = lib globalConfig.language = SimplifiedLocale(lang) globalConfig.domain = dom - globalConfig.storage.SetDomain(dom) - globalConfig.Unlock() loadStorage(true)