From 7e57ca0cf54664aeb738b2eb275e656362129cf9 Mon Sep 17 00:00:00 2001 From: Dean Karn Date: Mon, 11 Nov 2019 12:42:35 -0800 Subject: [PATCH] convert to go modules --- .travis.yml | 29 +++++++ Makefile | 6 +- README.md | 24 +++--- _examples/custom-validation/main.go | 2 +- _examples/custom/main.go | 2 +- _examples/dive/main.go | 2 +- .../gin-upgrading-overriding/v8_to_v9.go | 2 +- _examples/simple/main.go | 2 +- _examples/struct-level/main.go | 2 +- _examples/translations/main.go | 4 +- examples_test.go | 83 ------------------- go.mod | 10 +++ go.sum | 21 +++++ non-standard/validators/notblank.go | 2 +- non-standard/validators/notblank_test.go | 4 +- translations/en/en.go | 2 +- translations/en/en_test.go | 4 +- translations/fr/fr.go | 2 +- translations/fr/fr_test.go | 4 +- translations/id/id.go | 2 +- translations/id/id_test.go | 4 +- translations/ja/ja.go | 2 +- translations/ja/ja_test.go | 4 +- translations/nl/nl.go | 2 +- translations/nl/nl_test.go | 4 +- translations/pt_BR/pt_BR.go | 2 +- translations/pt_BR/pt_BR_test.go | 4 +- translations/tr/tr.go | 2 +- translations/tr/tr_test.go | 4 +- translations/zh/zh.go | 2 +- translations/zh/zh_test.go | 4 +- translations/zh_tw/zh_tw.go | 2 +- translations/zh_tw/zh_tw_test.go | 4 +- validator_test.go | 2 +- 34 files changed, 114 insertions(+), 137 deletions(-) create mode 100644 .travis.yml delete mode 100644 examples_test.go create mode 100644 go.mod create mode 100644 go.sum diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b88bb9f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +language: go +go: + - 1.13.4 + - tip +matrix: + allow_failures: + - go: tip + +notifications: + email: + recipients: dean.karn@gmail.com + on_success: change + on_failure: always + +before_install: + - go install github.com/mattn/goveralls + - mkdir -p $GOPATH/src/gopkg.in + - ln -s $GOPATH/src/github.com/$TRAVIS_REPO_SLUG $GOPATH/src/gopkg.in/validator.v9 + +# Only clone the most recent commit. +git: + depth: 1 + +script: + - go test -v -race -covermode=atomic -coverprofile=coverage.coverprofile ./... + +after_success: | + [ $TRAVIS_GO_VERSION = 1.13.4 ] && + goveralls -coverprofile=coverage.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN \ No newline at end of file diff --git a/Makefile b/Makefile index b912cae..19c91ed 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ -GOCMD=go +GOCMD=GO111MODULE=on go linters-install: @golangci-lint --version >/dev/null 2>&1 || { \ echo "installing linting tools..."; \ - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.19.1; \ + curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0; \ } lint: linters-install - golangci-lint run + $(PWD)/bin/golangci-lint run test: $(GOCMD) test -cover -race ./... diff --git a/README.md b/README.md index 24318de..f712fff 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ Package validator ================ [![Join the chat at https://gitter.im/go-playground/validator](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-playground/validator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -![Project status](https://img.shields.io/badge/version-9.30.0-green.svg) -[![Build Status](https://semaphoreci.com/api/v1/joeybloggs/validator/branches/v9/badge.svg)](https://semaphoreci.com/joeybloggs/validator) -[![Coverage Status](https://coveralls.io/repos/go-playground/validator/badge.svg?branch=v9&service=github)](https://coveralls.io/github/go-playground/validator?branch=v9) +![Project status](https://img.shields.io/badge/version-10.0.0-green.svg) +[![Build Status](https://travis-ci.org/go-playground/validator.svg?branch=master)](https://travis-ci.org/go-playground/validator) +[![Coverage Status](https://coveralls.io/repos/go-playground/validator/badge.svg?branch=master&service=github)](https://coveralls.io/github/go-playground/validator?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/validator)](https://goreportcard.com/report/github.com/go-playground/validator) -[![GoDoc](https://godoc.org/gopkg.in/go-playground/validator.v9?status.svg)](https://godoc.org/gopkg.in/go-playground/validator.v9) +[![GoDoc](https://godoc.org/github.com/go-playground/validator?status.svg)](https://godoc.org/github.com/go-playground/validator) ![License](https://img.shields.io/dub/l/vibe-d.svg) Package validator implements value validations for structs and individual fields based on tags. @@ -20,18 +20,18 @@ It has the following **unique** features: - Alias validation tags, which allows for mapping of several validations to a single tag for easier defining of validations on structs - Extraction of custom defined Field Name e.g. can specify to extract the JSON name while validating and have it available in the resulting FieldError - Customizable i18n aware error messages. -- Default validator for the [gin](https://github.com/gin-gonic/gin) web framework; upgrading from v8 to v9 in gin see [here](https://github.com/go-playground/validator/tree/v9/_examples/gin-upgrading-overriding) +- Default validator for the [gin](https://github.com/gin-gonic/gin) web framework; upgrading from v8 to v9 in gin see [here](https://github.com/go-playground/validator/tree/master/_examples/gin-upgrading-overriding) Installation ------------ Use go get. - go get gopkg.in/go-playground/validator.v9 + go get github.com/go-playground/validator/v10 Then import the validator package into your own code. - import "gopkg.in/go-playground/validator.v9" + import "github.com/go-playground/validator/v10" Error Return Value ------- @@ -53,14 +53,14 @@ validationErrors := err.(validator.ValidationErrors) Usage and documentation ------ -Please see http://godoc.org/gopkg.in/go-playground/validator.v9 for detailed usage docs. +Please see http://godoc.org/github.com/go-playground/validator/v10 for detailed usage docs. ##### Examples: -- [Simple](https://github.com/go-playground/validator/blob/v9/_examples/simple/main.go) -- [Custom Field Types](https://github.com/go-playground/validator/blob/v9/_examples/custom/main.go) -- [Struct Level](https://github.com/go-playground/validator/blob/v9/_examples/struct-level/main.go) -- [Translations & Custom Errors](https://github.com/go-playground/validator/blob/v9/_examples/translations/main.go) +- [Simple](https://github.com/go-playground/validator/blob/master/_examples/simple/main.go) +- [Custom Field Types](https://github.com/go-playground/validator/blob/master/_examples/custom/main.go) +- [Struct Level](https://github.com/go-playground/validator/blob/master/_examples/struct-level/main.go) +- [Translations & Custom Errors](https://github.com/go-playground/validator/blob/master/_examples/translations/main.go) - [Gin upgrade and/or override validator](https://github.com/go-playground/validator/tree/v9/_examples/gin-upgrading-overriding) - [wash - an example application putting it all together](https://github.com/bluesuncorp/wash) diff --git a/_examples/custom-validation/main.go b/_examples/custom-validation/main.go index 89781b6..6ba8ef2 100644 --- a/_examples/custom-validation/main.go +++ b/_examples/custom-validation/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // MyStruct .. diff --git a/_examples/custom/main.go b/_examples/custom/main.go index 724f57a..f44ef4c 100644 --- a/_examples/custom/main.go +++ b/_examples/custom/main.go @@ -6,7 +6,7 @@ import ( "fmt" "reflect" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // DbBackedUser User struct diff --git a/_examples/dive/main.go b/_examples/dive/main.go index 6c7de1e..18b9e7f 100644 --- a/_examples/dive/main.go +++ b/_examples/dive/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // Test ... diff --git a/_examples/gin-upgrading-overriding/v8_to_v9.go b/_examples/gin-upgrading-overriding/v8_to_v9.go index 014e3f5..65abe02 100644 --- a/_examples/gin-upgrading-overriding/v8_to_v9.go +++ b/_examples/gin-upgrading-overriding/v8_to_v9.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/gin-gonic/gin/binding" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) type defaultValidator struct { diff --git a/_examples/simple/main.go b/_examples/simple/main.go index 459356d..eb9af79 100644 --- a/_examples/simple/main.go +++ b/_examples/simple/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // User contains user information diff --git a/_examples/struct-level/main.go b/_examples/struct-level/main.go index 1c505e6..5e69f6b 100644 --- a/_examples/struct-level/main.go +++ b/_examples/struct-level/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // User contains user information diff --git a/_examples/translations/main.go b/_examples/translations/main.go index 0c298e4..6f9466d 100644 --- a/_examples/translations/main.go +++ b/_examples/translations/main.go @@ -5,8 +5,8 @@ import ( "github.com/go-playground/locales/en" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" - en_translations "gopkg.in/go-playground/validator.v9/translations/en" + "github.com/go-playground/validator/v10" + en_translations "github.com/go-playground/validator/v10/translations/en" ) // User contains user information diff --git a/examples_test.go b/examples_test.go deleted file mode 100644 index 3f4df7e..0000000 --- a/examples_test.go +++ /dev/null @@ -1,83 +0,0 @@ -package validator_test - -// import ( -// "fmt" - -// "gopkg.in/go-playground/validator.v8" -// ) - -// func ExampleValidate_new() { -// config := &validator.Config{TagName: "validate"} - -// validator.New(config) -// } - -// func ExampleValidate_field() { -// // This should be stored somewhere globally -// var validate *validator.Validate - -// config := &validator.Config{TagName: "validate"} - -// validate = validator.New(config) - -// i := 0 -// errs := validate.Field(i, "gt=1,lte=10") -// err := errs.(validator.ValidationErrors)[""] -// fmt.Println(err.Field) -// fmt.Println(err.Tag) -// fmt.Println(err.Kind) // NOTE: Kind and Type can be different i.e. time Kind=struct and Type=time.Time -// fmt.Println(err.Type) -// fmt.Println(err.Param) -// fmt.Println(err.Value) -// //Output: -// // -// //gt -// //int -// //int -// //1 -// //0 -// } - -// func ExampleValidate_struct() { -// // This should be stored somewhere globally -// var validate *validator.Validate - -// config := &validator.Config{TagName: "validate"} - -// validate = validator.New(config) - -// type ContactInformation struct { -// Phone string `validate:"required"` -// Street string `validate:"required"` -// City string `validate:"required"` -// } - -// type User struct { -// Name string `validate:"required,excludesall=!@#$%^&*()_+-=:;?/0x2C"` // 0x2C = comma (,) -// Age int8 `validate:"required,gt=0,lt=150"` -// Email string `validate:"email"` -// ContactInformation []*ContactInformation -// } - -// contactInfo := &ContactInformation{ -// Street: "26 Here Blvd.", -// City: "Paradeso", -// } - -// user := &User{ -// Name: "Joey Bloggs", -// Age: 31, -// Email: "joeybloggs@gmail.com", -// ContactInformation: []*ContactInformation{contactInfo}, -// } - -// errs := validate.Struct(user) -// for _, v := range errs.(validator.ValidationErrors) { -// fmt.Println(v.Field) // Phone -// fmt.Println(v.Tag) // required -// //... and so forth -// //Output: -// //Phone -// //required -// } -// } diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..21316b3 --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/go-playground/validator/v10 + +go 1.13 + +require ( + github.com/go-playground/assert/v2 v2.0.1 + github.com/go-playground/locales v0.13.0 + github.com/go-playground/universal-translator v0.17.0 + github.com/leodido/go-urn v1.2.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..dc7dec4 --- /dev/null +++ b/go.sum @@ -0,0 +1,21 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/non-standard/validators/notblank.go b/non-standard/validators/notblank.go index e2269c4..80c815f 100644 --- a/non-standard/validators/notblank.go +++ b/non-standard/validators/notblank.go @@ -4,7 +4,7 @@ import ( "reflect" "strings" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // NotBlank is the validation function for validating if the current field diff --git a/non-standard/validators/notblank_test.go b/non-standard/validators/notblank_test.go index 036f06d..78c8781 100644 --- a/non-standard/validators/notblank_test.go +++ b/non-standard/validators/notblank_test.go @@ -3,8 +3,8 @@ package validators import ( "testing" - "gopkg.in/go-playground/validator.v9" - "gopkg.in/go-playground/assert.v1" + "github.com/go-playground/validator/v10" + "github.com/go-playground/assert/v2" ) type test struct { diff --git a/translations/en/en.go b/translations/en/en.go index 08b0043..fd43f38 100644 --- a/translations/en/en.go +++ b/translations/en/en.go @@ -10,7 +10,7 @@ import ( "github.com/go-playground/locales" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // RegisterDefaultTranslations registers a set of default translations diff --git a/translations/en/en_test.go b/translations/en/en_test.go index 829d549..cddcb84 100644 --- a/translations/en/en_test.go +++ b/translations/en/en_test.go @@ -6,8 +6,8 @@ import ( english "github.com/go-playground/locales/en" ut "github.com/go-playground/universal-translator" - . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/validator.v9" + . "github.com/go-playground/assert/v2" + "github.com/go-playground/validator/v10" ) func TestTranslations(t *testing.T) { diff --git a/translations/fr/fr.go b/translations/fr/fr.go index 1bf5dae..ddebdf9 100644 --- a/translations/fr/fr.go +++ b/translations/fr/fr.go @@ -10,7 +10,7 @@ import ( "github.com/go-playground/locales" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // RegisterDefaultTranslations registers a set of default translations diff --git a/translations/fr/fr_test.go b/translations/fr/fr_test.go index ea8d5f7..a3f864c 100644 --- a/translations/fr/fr_test.go +++ b/translations/fr/fr_test.go @@ -6,8 +6,8 @@ import ( french "github.com/go-playground/locales/fr" ut "github.com/go-playground/universal-translator" - . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/validator.v9" + . "github.com/go-playground/assert/v2" + "github.com/go-playground/validator/v10" ) func TestTranslations(t *testing.T) { diff --git a/translations/id/id.go b/translations/id/id.go index ec029fe..d185dfc 100644 --- a/translations/id/id.go +++ b/translations/id/id.go @@ -10,7 +10,7 @@ import ( "github.com/go-playground/locales" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // RegisterDefaultTranslations registers a set of default translations diff --git a/translations/id/id_test.go b/translations/id/id_test.go index 6b746d7..83a72aa 100644 --- a/translations/id/id_test.go +++ b/translations/id/id_test.go @@ -6,8 +6,8 @@ import ( indonesia "github.com/go-playground/locales/id" ut "github.com/go-playground/universal-translator" - . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/validator.v9" + . "github.com/go-playground/assert/v2" + "github.com/go-playground/validator/v10" ) func TestTranslations(t *testing.T) { diff --git a/translations/ja/ja.go b/translations/ja/ja.go index 6513117..43ec648 100644 --- a/translations/ja/ja.go +++ b/translations/ja/ja.go @@ -10,7 +10,7 @@ import ( "github.com/go-playground/locales" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // RegisterDefaultTranslations registers a set of default translations diff --git a/translations/ja/ja_test.go b/translations/ja/ja_test.go index 742794a..0120760 100644 --- a/translations/ja/ja_test.go +++ b/translations/ja/ja_test.go @@ -6,8 +6,8 @@ import ( ja_locale "github.com/go-playground/locales/ja" ut "github.com/go-playground/universal-translator" - . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/validator.v9" + . "github.com/go-playground/assert/v2" + "github.com/go-playground/validator/v10" ) func TestTranslations(t *testing.T) { diff --git a/translations/nl/nl.go b/translations/nl/nl.go index 4b13e8b..a64815d 100644 --- a/translations/nl/nl.go +++ b/translations/nl/nl.go @@ -10,7 +10,7 @@ import ( "github.com/go-playground/locales" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // RegisterDefaultTranslations registers a set of default translations diff --git a/translations/nl/nl_test.go b/translations/nl/nl_test.go index 262be68..55f5048 100644 --- a/translations/nl/nl_test.go +++ b/translations/nl/nl_test.go @@ -6,8 +6,8 @@ import ( english "github.com/go-playground/locales/en" ut "github.com/go-playground/universal-translator" - . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/validator.v9" + . "github.com/go-playground/assert/v2" + "github.com/go-playground/validator/v10" ) func TestTranslations(t *testing.T) { diff --git a/translations/pt_BR/pt_BR.go b/translations/pt_BR/pt_BR.go index c6d73b3..df4fc67 100644 --- a/translations/pt_BR/pt_BR.go +++ b/translations/pt_BR/pt_BR.go @@ -10,7 +10,7 @@ import ( "github.com/go-playground/locales" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // RegisterDefaultTranslations registers a set of default translations diff --git a/translations/pt_BR/pt_BR_test.go b/translations/pt_BR/pt_BR_test.go index 8f7e710..32125f6 100644 --- a/translations/pt_BR/pt_BR_test.go +++ b/translations/pt_BR/pt_BR_test.go @@ -6,8 +6,8 @@ import ( brazilian_portuguese "github.com/go-playground/locales/pt_BR" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" - . "gopkg.in/go-playground/assert.v1" + "github.com/go-playground/validator/v10" + . "github.com/go-playground/assert/v2" ) func TestTranslations(t *testing.T) { diff --git a/translations/tr/tr.go b/translations/tr/tr.go index fd2f34f..2709e4b 100644 --- a/translations/tr/tr.go +++ b/translations/tr/tr.go @@ -10,7 +10,7 @@ import ( "github.com/go-playground/locales" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // RegisterDefaultTranslations registers a set of default translations diff --git a/translations/tr/tr_test.go b/translations/tr/tr_test.go index 7fc4639..7cfa5a4 100644 --- a/translations/tr/tr_test.go +++ b/translations/tr/tr_test.go @@ -6,8 +6,8 @@ import ( turkish "github.com/go-playground/locales/tr" ut "github.com/go-playground/universal-translator" - . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/validator.v9" + . "github.com/go-playground/assert/v2" + "github.com/go-playground/validator/v10" ) func TestTranslations(t *testing.T) { diff --git a/translations/zh/zh.go b/translations/zh/zh.go index 09dc84a..c3032b7 100644 --- a/translations/zh/zh.go +++ b/translations/zh/zh.go @@ -10,7 +10,7 @@ import ( "github.com/go-playground/locales" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // RegisterDefaultTranslations registers a set of default translations diff --git a/translations/zh/zh_test.go b/translations/zh/zh_test.go index a7a4a01..26a21ae 100644 --- a/translations/zh/zh_test.go +++ b/translations/zh/zh_test.go @@ -6,8 +6,8 @@ import ( zhongwen "github.com/go-playground/locales/zh" ut "github.com/go-playground/universal-translator" - . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/validator.v9" + . "github.com/go-playground/assert/v2" + "github.com/go-playground/validator/v10" ) func TestTranslations(t *testing.T) { diff --git a/translations/zh_tw/zh_tw.go b/translations/zh_tw/zh_tw.go index 05652fb..cf6f933 100644 --- a/translations/zh_tw/zh_tw.go +++ b/translations/zh_tw/zh_tw.go @@ -10,7 +10,7 @@ import ( "github.com/go-playground/locales" ut "github.com/go-playground/universal-translator" - "gopkg.in/go-playground/validator.v9" + "github.com/go-playground/validator/v10" ) // RegisterDefaultTranslations registers a set of default translations diff --git a/translations/zh_tw/zh_tw_test.go b/translations/zh_tw/zh_tw_test.go index 809653e..a4463a2 100644 --- a/translations/zh_tw/zh_tw_test.go +++ b/translations/zh_tw/zh_tw_test.go @@ -6,8 +6,8 @@ import ( zhongwen "github.com/go-playground/locales/zh_Hant_TW" ut "github.com/go-playground/universal-translator" - . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/validator.v9" + . "github.com/go-playground/assert/v2" + "github.com/go-playground/validator/v10" ) func TestTranslations(t *testing.T) { diff --git a/validator_test.go b/validator_test.go index 6f42a91..d74247f 100644 --- a/validator_test.go +++ b/validator_test.go @@ -18,7 +18,7 @@ import ( "github.com/go-playground/locales/fr" "github.com/go-playground/locales/nl" ut "github.com/go-playground/universal-translator" - . "gopkg.in/go-playground/assert.v1" + . "github.com/go-playground/assert/v2" ) // NOTES: