diff options
author | Albert Nigmatzianov <albertnigma@gmail.com> | 2016-11-07 02:10:32 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-11-07 02:10:32 +0300 |
commit | 85a2d81e3c1f62b561e6c2715cc406446879d09e (patch) | |
tree | 3ed54195fb0f8283082827a4890a138fca25504d /tpl | |
parent | 4b4ab4755339a8c1d034be1f75b323d585dac1df (diff) |
commands, tpl: Get rid of repeating viper accesses
* all: Delete some blank lines
* commands, tpl: Get rid of repeating viper accesses
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/template_i18n.go | 3 | ||||
-rw-r--r-- | tpl/template_resources.go | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tpl/template_i18n.go b/tpl/template_i18n.go index 9b681b4cd..1bec65a78 100644 --- a/tpl/template_i18n.go +++ b/tpl/template_i18n.go @@ -65,6 +65,7 @@ func SetI18nTfuncs(bndl *bundle.Bundle) { jww.WARN.Printf("No translation bundle found for default language %q", defaultContentLanguage) } + enableMissingTranslationPlaceholders := viper.GetBool("enableMissingTranslationPlaceholders") for _, lang := range bndl.LanguageTags() { currentLang := lang @@ -78,7 +79,7 @@ func SetI18nTfuncs(bndl *bundle.Bundle) { if Logi18nWarnings { i18nWarningLogger.Printf("i18n|MISSING_TRANSLATION|%s|%s", currentLang, translationID) } - if viper.GetBool("enableMissingTranslationPlaceholders") { + if enableMissingTranslationPlaceholders { return fmt.Sprintf("[i18n] %s", translationID) } if defaultT != nil { diff --git a/tpl/template_resources.go b/tpl/template_resources.go index 507df307e..116d5df61 100644 --- a/tpl/template_resources.go +++ b/tpl/template_resources.go @@ -114,7 +114,6 @@ func resDeleteCache(id string, fs afero.Fs) error { // resGetRemote loads the content of a remote file. This method is thread safe. func resGetRemote(url string, fs afero.Fs, hc *http.Client) ([]byte, error) { - c, err := resGetCache(url, fs, viper.GetBool("ignoreCache")) if c != nil && err == nil { return c, nil |