Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: include major in go.mod module directive #449

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A package of validators and sanitizers for strings, structs and collections. Bas
Make sure that Go is installed on your computer.
Type the following command in your terminal:

go get github.com/asaskevich/govalidator
go get github.com/asaskevich/govalidator/v11

or you can get specified release of the package with `gopkg.in`:

Expand All @@ -22,12 +22,12 @@ After it the package is ready to use.
#### Import package in your project
Add following line in your `*.go` file:
```go
import "github.com/asaskevich/govalidator"
import "github.com/asaskevich/govalidator/v11"
```
If you are unhappy to use long `govalidator`, you can do something like this:
```go
import (
valid "github.com/asaskevich/govalidator"
valid "github.com/asaskevich/govalidator/v11"
)
```

Expand All @@ -37,7 +37,7 @@ import (
`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors.

```go
import "github.com/asaskevich/govalidator"
import "github.com/asaskevich/govalidator/v11"

func init() {
govalidator.SetFieldsRequiredByDefault(true)
Expand Down Expand Up @@ -69,7 +69,7 @@ type exampleStruct2 struct {
##### Custom validator function signature
A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible.
```go
import "github.com/asaskevich/govalidator"
import "github.com/asaskevich/govalidator/v11"

// old signature
func(i interface{}) bool
Expand All @@ -81,7 +81,7 @@ func(i interface{}, o interface{}) bool
##### Adding a custom validator
This was changed to prevent data races when accessing custom validators.
```go
import "github.com/asaskevich/govalidator"
import "github.com/asaskevich/govalidator/v11"

// before
govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool {
Expand Down Expand Up @@ -483,7 +483,7 @@ println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaa
###### Custom validation functions
Custom validation using your own domain specific validators is also available - here's an example of how to use it:
```go
import "github.com/asaskevich/govalidator"
import "github.com/asaskevich/govalidator/v11"

type CustomByteArray [6]byte // custom types are supported and can be validated

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/asaskevich/govalidator
module github.com/asaskevich/govalidator/v11

go 1.13