commands, tpl: Get rid of repeating viper accesses

* all: Delete some blank lines
* commands, tpl: Get rid of repeating viper accesses
This commit is contained in:
Albert Nigmatzianov
2016-11-07 00:10:32 +01:00
committed by Bjørn Erik Pedersen
parent 4b4ab47553
commit 85a2d81e3c
9 changed files with 5 additions and 14 deletions

View File

@@ -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 {

View File

@@ -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