Skip to content

Commit 1cbfa0b

Browse files
author
Dean Karn
authored
RC1 Release
1 parent b0883e6 commit 1cbfa0b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Package validator
66
[![Build Status](https://semaphoreci.com/api/v1/projects/ec20115f-ef1b-4c7d-9393-cc76aba74eb4/530054/badge.svg)](https://semaphoreci.com/joeybloggs/validator)
77
[![Coverage Status](https://coveralls.io/repos/go-playground/validator/badge.svg?branch=v9&service=github)](https://coveralls.io/github/go-playground/validator?branch=v9)
88
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/validator)](https://goreportcard.com/report/github.com/go-playground/validator)
9-
[![GoDoc](https://godoc.org/gopkg.in/go-playground/validator.v9?status.svg)](https://godoc.org/gopkg.in/go-playground/validator.v8)
9+
[![GoDoc](https://godoc.org/gopkg.in/go-playground/validator.v9?status.svg)](https://godoc.org/gopkg.in/go-playground/validator.v9)
1010
![License](https://img.shields.io/dub/l/vibe-d.svg)
1111

1212
Package validator implements value validations for structs and individual fields based on tags.
@@ -45,9 +45,7 @@ They return type error to avoid the issue discussed in the following, where err
4545
* http://stackoverflow.com/a/29138676/3158232
4646
* https://github.com/go-playground/validator/issues/134
4747

48-
validator only returns nil or ValidationErrors as type error; so in you code all you need to do
49-
is check if the error returned is not nil, and if it's not type cast it to type ValidationErrors
50-
like so:
48+
Validator only InvalidValidationError for bad validation input, nil or ValidationErrors as type error; so, in your code all you need to do is check if the error returned is not nil, and if it's not check if error is InvalidValidationError ( if necessary, most of the time it isn't ) type cast it to type ValidationErrors like so:
5149

5250
```go
5351
err := validate.Struct(mystruct)

0 commit comments

Comments
 (0)