diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-12-02 13:23:25 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-12-03 13:12:58 +0100 |
commit | d90e37e0c6e812f9913bf256c9c81aa05b7a08aa (patch) | |
tree | 7b1b14464eefec1188ca2eed53c64e4823453cc9 /langs/i18n | |
parent | 32471b57bde51c55a15dbf1db75d6e5f7232c347 (diff) |
all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
Diffstat (limited to 'langs/i18n')
-rw-r--r-- | langs/i18n/i18n.go | 6 | ||||
-rw-r--r-- | langs/i18n/i18n_test.go | 3 | ||||
-rw-r--r-- | langs/i18n/translationProvider.go | 2 |
3 files changed, 1 insertions, 10 deletions
diff --git a/langs/i18n/i18n.go b/langs/i18n/i18n.go index 31cb5d732..dab620be6 100644 --- a/langs/i18n/i18n.go +++ b/langs/i18n/i18n.go @@ -27,9 +27,7 @@ import ( type translateFunc func(translationID string, templateData interface{}) string -var ( - i18nWarningLogger = helpers.NewDistinctFeedbackLogger() -) +var i18nWarningLogger = helpers.NewDistinctFeedbackLogger() // Translator handles i18n translations. type Translator struct { @@ -60,7 +58,6 @@ func (t Translator) Func(lang string) translateFunc { return func(translationID string, args interface{}) string { return "" } - } func (t Translator) initFuncs(bndl *i18n.Bundle) { @@ -72,7 +69,6 @@ func (t Translator) initFuncs(bndl *i18n.Bundle) { currentLangKey := strings.ToLower(strings.TrimPrefix(currentLangStr, artificialLangTagPrefix)) localizer := i18n.NewLocalizer(bndl, currentLangStr) t.translateFuncs[currentLangKey] = func(translationID string, templateData interface{}) string { - var pluralCount interface{} if templateData != nil { diff --git a/langs/i18n/i18n_test.go b/langs/i18n/i18n_test.go index fa78f708c..7b5a10d67 100644 --- a/langs/i18n/i18n_test.go +++ b/langs/i18n/i18n_test.go @@ -244,7 +244,6 @@ func doTestI18nTranslate(t testing.TB, test i18nTest, cfg config.Provider) strin tp := prepareTranslationProvider(t, test, cfg) f := tp.t.Func(test.lang) return f(test.id, test.args) - } func prepareTranslationProvider(t testing.TB, test i18nTest, cfg config.Provider) *TranslationProvider { @@ -298,7 +297,6 @@ func getConfig() *viper.Viper { v.Set("allModules", modules.Modules{mod}) return v - } func TestI18nTranslate(t *testing.T) { @@ -339,5 +337,4 @@ func BenchmarkI18nTranslate(b *testing.B) { } }) } - } diff --git a/langs/i18n/translationProvider.go b/langs/i18n/translationProvider.go index 07bd9219a..302ca84c6 100644 --- a/langs/i18n/translationProvider.go +++ b/langs/i18n/translationProvider.go @@ -73,7 +73,6 @@ func (tp *TranslationProvider) Update(d *deps.Deps) error { d.Translate = tp.t.Func(d.Language.Lang) return nil - } const artificialLangTagPrefix = "art-x-" @@ -138,5 +137,4 @@ func errWithFileContext(inerr error, r source.File) error { herrors.SimpleLineMatcher) return err - } |