From 2055811d7fce4ae44b268cab90f33f9145d250c8 Mon Sep 17 00:00:00 2001 From: joeybloggs Date: Thu, 24 Sep 2015 07:40:50 -0400 Subject: [PATCH] update org from bluesuncorp to go-playground --- README.md | 16 ++++++++-------- examples/simple.go | 2 +- examples_test.go | 2 +- validator_test.go | 44 ++++++++++++++++++++++---------------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index ac50d6e..1a78bec 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ Package validator ================ -[![Join the chat at https://gitter.im/bluesuncorp/validator](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bluesuncorp/validator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![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) [![Build Status](https://semaphoreci.com/api/v1/projects/ec20115f-ef1b-4c7d-9393-cc76aba74eb4/487382/badge.svg)](https://semaphoreci.com/joeybloggs/validator) -[![Coverage Status](https://coveralls.io/repos/bluesuncorp/validator/badge.svg?branch=v5)](https://coveralls.io/r/bluesuncorp/validator?branch=v5) -[![GoDoc](https://godoc.org/gopkg.in/bluesuncorp/validator.v5?status.svg)](https://godoc.org/gopkg.in/bluesuncorp/validator.v5) +[![Coverage Status](https://coveralls.io/repos/go-playground/validator/badge.svg?branch=v5)](https://coveralls.io/r/go-playground/validator?branch=v5) +[![GoDoc](https://godoc.org/gopkg.in/go-playground/validator.v5?status.svg)](https://godoc.org/gopkg.in/go-playground/validator.v5) Package validator implements value validations for structs and individual fields based on tags. @@ -19,20 +19,20 @@ Installation Use go get. - go get gopkg.in/bluesuncorp/validator.v5 + go get gopkg.in/go-playground/validator.v5 or to update - go get -u gopkg.in/bluesuncorp/validator.v5 + go get -u gopkg.in/go-playground/validator.v5 Then import the validator package into your own code. - import "gopkg.in/bluesuncorp/validator.v5" + import "gopkg.in/go-playground/validator.v5" Usage and documentation ------ -Please see http://godoc.org/gopkg.in/bluesuncorp/validator.v5 for detailed usage docs. +Please see http://godoc.org/gopkg.in/go-playground/validator.v5 for detailed usage docs. ##### Example: ```go @@ -41,7 +41,7 @@ package main import ( "fmt" - "gopkg.in/bluesuncorp/validator.v5" + "gopkg.in/go-playground/validator.v5" ) // User contains user information diff --git a/examples/simple.go b/examples/simple.go index 59cb1a9..c36bd68 100644 --- a/examples/simple.go +++ b/examples/simple.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "gopkg.in/bluesuncorp/validator.v5" + "gopkg.in/go-playground/validator.v5" ) // User contains user information diff --git a/examples_test.go b/examples_test.go index c5dd351..0acdaa0 100644 --- a/examples_test.go +++ b/examples_test.go @@ -3,7 +3,7 @@ package validator_test import ( "fmt" - "../validator" + "gopkg.in/go-playground/validator.v5" ) func ExampleValidate_new() { diff --git a/validator_test.go b/validator_test.go index fb6fa9d..0752932 100644 --- a/validator_test.go +++ b/validator_test.go @@ -362,7 +362,7 @@ func TestFlattenValidation(t *testing.T) { var errStructPtrArray [][]*Inner - errStructPtrArray = append(errStructPtrArray, []*Inner{&Inner{"ok"}, &Inner{""}, &Inner{"ok"}}) + errStructPtrArray = append(errStructPtrArray, []*Inner{{"ok"}, {""}, {"ok"}}) tmsp := &TestMultiDimensionalStructsPtr{ Errs: errStructPtrArray, @@ -396,7 +396,7 @@ func TestFlattenValidation(t *testing.T) { Equal(t, structErrFlatten.Tag, "required") errStructPtrArray = [][]*Inner{} - errStructPtrArray = append(errStructPtrArray, []*Inner{&Inner{"ok"}, nil, &Inner{"ok"}}) + errStructPtrArray = append(errStructPtrArray, []*Inner{{"ok"}, nil, {"ok"}}) tmsp = &TestMultiDimensionalStructsPtr{ Errs: errStructPtrArray, @@ -428,7 +428,7 @@ func TestFlattenValidation(t *testing.T) { Errs map[int]*Inner `validate:"gt=0,dive,required"` } - mip := map[int]*Inner{0: &Inner{"ok"}, 3: &Inner{""}, 4: &Inner{"ok"}} + mip := map[int]*Inner{0: {"ok"}, 3: {""}, 4: {"ok"}} msp := &TestMapStructPtr{ Errs: mip, @@ -460,7 +460,7 @@ func TestFlattenValidation(t *testing.T) { Equal(t, flatErrs.Field, "Name") Equal(t, flatErrs.Tag, "required") - mip2 := map[int]*Inner{0: &Inner{"ok"}, 3: nil, 4: &Inner{"ok"}} + mip2 := map[int]*Inner{0: {"ok"}, 3: nil, 4: {"ok"}} msp2 := &TestMapStructPtr{ Errs: mip2, @@ -491,7 +491,7 @@ func TestFlattenValidation(t *testing.T) { Errs map[int][]string `validate:"gt=0,dive,dive,required"` } - mias := map[int][]string{0: []string{"ok"}, 3: []string{"ok", ""}, 4: []string{"ok"}} + mias := map[int][]string{0: {"ok"}, 3: {"ok", ""}, 4: {"ok"}} mia := &TestMapInnerArrayStruct{ Errs: mias, @@ -658,9 +658,9 @@ func TestInterfaceErrValidation(t *testing.T) { var errStructPtr2Array [][]*Inner - errStructPtr2Array = append(errStructPtr2Array, []*Inner{&Inner{"ok"}, &Inner{""}, &Inner{""}}) - errStructPtr2Array = append(errStructPtr2Array, []*Inner{&Inner{"ok"}, &Inner{""}, &Inner{""}}) - errStructPtr2Array = append(errStructPtr2Array, []*Inner{&Inner{"ok"}, &Inner{""}, nil}) + errStructPtr2Array = append(errStructPtr2Array, []*Inner{{"ok"}, {""}, {""}}) + errStructPtr2Array = append(errStructPtr2Array, []*Inner{{"ok"}, {""}, {""}}) + errStructPtr2Array = append(errStructPtr2Array, []*Inner{{"ok"}, {""}, nil}) tmsp2 := &TestMultiDimensionalStructsPtr2{ Errs: errStructPtr2Array, @@ -767,7 +767,7 @@ func TestMapDiveValidation(t *testing.T) { Errs map[int]Inner `validate:"gt=0,dive"` } - mi := map[int]Inner{0: Inner{"ok"}, 3: Inner{""}, 4: Inner{"ok"}} + mi := map[int]Inner{0: {"ok"}, 3: {""}, 4: {"ok"}} ms := &TestMapStruct{ Errs: mi, @@ -828,7 +828,7 @@ func TestMapDiveValidation(t *testing.T) { Errs map[int]*Inner `validate:"gt=0,dive,required"` } - mip := map[int]*Inner{0: &Inner{"ok"}, 3: nil, 4: &Inner{"ok"}} + mip := map[int]*Inner{0: {"ok"}, 3: nil, 4: {"ok"}} msp := &TestMapStructPtr{ Errs: mip, @@ -855,7 +855,7 @@ func TestMapDiveValidation(t *testing.T) { Errs map[int]*Inner `validate:"gt=0,dive,omitempty,required"` } - mip2 := map[int]*Inner{0: &Inner{"ok"}, 3: nil, 4: &Inner{"ok"}} + mip2 := map[int]*Inner{0: {"ok"}, 3: nil, 4: {"ok"}} msp2 := &TestMapStructPtr2{ Errs: mip2, @@ -994,8 +994,8 @@ func TestArrayDiveValidation(t *testing.T) { var errStructArray [][]Inner - errStructArray = append(errStructArray, []Inner{Inner{"ok"}, Inner{""}, Inner{""}}) - errStructArray = append(errStructArray, []Inner{Inner{"ok"}, Inner{""}, Inner{""}}) + errStructArray = append(errStructArray, []Inner{{"ok"}, {""}, {""}}) + errStructArray = append(errStructArray, []Inner{{"ok"}, {""}, {""}}) tms := &TestMultiDimensionalStructs{ Errs: errStructArray, @@ -1032,9 +1032,9 @@ func TestArrayDiveValidation(t *testing.T) { var errStructPtrArray [][]*Inner - errStructPtrArray = append(errStructPtrArray, []*Inner{&Inner{"ok"}, &Inner{""}, &Inner{""}}) - errStructPtrArray = append(errStructPtrArray, []*Inner{&Inner{"ok"}, &Inner{""}, &Inner{""}}) - errStructPtrArray = append(errStructPtrArray, []*Inner{&Inner{"ok"}, &Inner{""}, nil}) + errStructPtrArray = append(errStructPtrArray, []*Inner{{"ok"}, {""}, {""}}) + errStructPtrArray = append(errStructPtrArray, []*Inner{{"ok"}, {""}, {""}}) + errStructPtrArray = append(errStructPtrArray, []*Inner{{"ok"}, {""}, nil}) tmsp := &TestMultiDimensionalStructsPtr{ Errs: errStructPtrArray, @@ -1086,9 +1086,9 @@ func TestArrayDiveValidation(t *testing.T) { var errStructPtr2Array [][]*Inner - errStructPtr2Array = append(errStructPtr2Array, []*Inner{&Inner{"ok"}, &Inner{""}, &Inner{""}}) - errStructPtr2Array = append(errStructPtr2Array, []*Inner{&Inner{"ok"}, &Inner{""}, &Inner{""}}) - errStructPtr2Array = append(errStructPtr2Array, []*Inner{&Inner{"ok"}, &Inner{""}, nil}) + errStructPtr2Array = append(errStructPtr2Array, []*Inner{{"ok"}, {""}, {""}}) + errStructPtr2Array = append(errStructPtr2Array, []*Inner{{"ok"}, {""}, {""}}) + errStructPtr2Array = append(errStructPtr2Array, []*Inner{{"ok"}, {""}, nil}) tmsp2 := &TestMultiDimensionalStructsPtr2{ Errs: errStructPtr2Array, @@ -1132,9 +1132,9 @@ func TestArrayDiveValidation(t *testing.T) { var errStructPtr3Array [][]*Inner - errStructPtr3Array = append(errStructPtr3Array, []*Inner{&Inner{"ok"}, &Inner{""}, &Inner{""}}) - errStructPtr3Array = append(errStructPtr3Array, []*Inner{&Inner{"ok"}, &Inner{""}, &Inner{""}}) - errStructPtr3Array = append(errStructPtr3Array, []*Inner{&Inner{"ok"}, &Inner{""}, nil}) + errStructPtr3Array = append(errStructPtr3Array, []*Inner{{"ok"}, {""}, {""}}) + errStructPtr3Array = append(errStructPtr3Array, []*Inner{{"ok"}, {""}, {""}}) + errStructPtr3Array = append(errStructPtr3Array, []*Inner{{"ok"}, {""}, nil}) tmsp3 := &TestMultiDimensionalStructsPtr3{ Errs: errStructPtr3Array,