From 73e8e76de2d45f1e537065c97e344e8f63fa582c Mon Sep 17 00:00:00 2001 From: Jawher Moussa Date: Thu, 22 Sep 2016 13:29:12 +0200 Subject: [PATCH] Fix universal translator imports so that goimports doesn't get remove them Running goimports on the codebase deletes all the imports of "github.com/go-playground/universal-translator". The fix consists of explicitly qualifying the import statements with ut. --- errors.go | 2 +- examples/translations/main.go | 2 +- translations.go | 2 +- translations/en/en.go | 2 +- translations/en/en_test.go | 2 +- validator_instance.go | 2 +- validator_test.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/errors.go b/errors.go index 7b6a556..84344ac 100644 --- a/errors.go +++ b/errors.go @@ -6,7 +6,7 @@ import ( "reflect" "strings" - "github.com/go-playground/universal-translator" + ut "github.com/go-playground/universal-translator" ) const ( diff --git a/examples/translations/main.go b/examples/translations/main.go index fa23165..0c298e4 100644 --- a/examples/translations/main.go +++ b/examples/translations/main.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/go-playground/locales/en" - "github.com/go-playground/universal-translator" + ut "github.com/go-playground/universal-translator" "gopkg.in/go-playground/validator.v9" en_translations "gopkg.in/go-playground/validator.v9/translations/en" ) diff --git a/translations.go b/translations.go index b968aaf..4465abb 100644 --- a/translations.go +++ b/translations.go @@ -1,6 +1,6 @@ package validator -import "github.com/go-playground/universal-translator" +import ut "github.com/go-playground/universal-translator" // TranslationFunc is the function type used to register or override // custom translations diff --git a/translations/en/en.go b/translations/en/en.go index 1c8c2fe..a5454cc 100644 --- a/translations/en/en.go +++ b/translations/en/en.go @@ -9,7 +9,7 @@ import ( "time" "github.com/go-playground/locales" - "github.com/go-playground/universal-translator" + ut "github.com/go-playground/universal-translator" "gopkg.in/go-playground/validator.v9" ) diff --git a/translations/en/en_test.go b/translations/en/en_test.go index 4203335..f5be5f6 100644 --- a/translations/en/en_test.go +++ b/translations/en/en_test.go @@ -5,7 +5,7 @@ import ( "time" english "github.com/go-playground/locales/en" - "github.com/go-playground/universal-translator" + ut "github.com/go-playground/universal-translator" . "gopkg.in/go-playground/assert.v1" "gopkg.in/go-playground/validator.v9" ) diff --git a/validator_instance.go b/validator_instance.go index 5d7ba3e..f956490 100644 --- a/validator_instance.go +++ b/validator_instance.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/go-playground/universal-translator" + ut "github.com/go-playground/universal-translator" ) const ( diff --git a/validator_test.go b/validator_test.go index 89f5ab8..ac922b7 100644 --- a/validator_test.go +++ b/validator_test.go @@ -15,7 +15,7 @@ import ( "github.com/go-playground/locales/en" "github.com/go-playground/locales/fr" "github.com/go-playground/locales/nl" - "github.com/go-playground/universal-translator" + ut "github.com/go-playground/universal-translator" ) // NOTES: