Skip to content

Commit 7e57ca0

Browse files
author
Dean Karn
committed
convert to go modules
1 parent cd1bd58 commit 7e57ca0

File tree

34 files changed

+114
-137
lines changed

34 files changed

+114
-137
lines changed

.travis.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
language: go
2+
go:
3+
- 1.13.4
4+
- tip
5+
matrix:
6+
allow_failures:
7+
- go: tip
8+
9+
notifications:
10+
email:
11+
recipients: [email protected]
12+
on_success: change
13+
on_failure: always
14+
15+
before_install:
16+
- go install github.com/mattn/goveralls
17+
- mkdir -p $GOPATH/src/gopkg.in
18+
- ln -s $GOPATH/src/github.com/$TRAVIS_REPO_SLUG $GOPATH/src/gopkg.in/validator.v9
19+
20+
# Only clone the most recent commit.
21+
git:
22+
depth: 1
23+
24+
script:
25+
- go test -v -race -covermode=atomic -coverprofile=coverage.coverprofile ./...
26+
27+
after_success: |
28+
[ $TRAVIS_GO_VERSION = 1.13.4 ] &&
29+
goveralls -coverprofile=coverage.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
GOCMD=go
1+
GOCMD=GO111MODULE=on go
22

33
linters-install:
44
@golangci-lint --version >/dev/null 2>&1 || { \
55
echo "installing linting tools..."; \
6-
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.19.1; \
6+
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0; \
77
}
88

99
lint: linters-install
10-
golangci-lint run
10+
$(PWD)/bin/golangci-lint run
1111

1212
test:
1313
$(GOCMD) test -cover -race ./...

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package validator
22
================
33
<img align="right" src="https://raw.githubusercontent.com/go-playground/validator/v9/logo.png">[![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)
4-
![Project status](https://img.shields.io/badge/version-9.30.0-green.svg)
5-
[![Build Status](https://semaphoreci.com/api/v1/joeybloggs/validator/branches/v9/badge.svg)](https://semaphoreci.com/joeybloggs/validator)
6-
[![Coverage Status](https://coveralls.io/repos/go-playground/validator/badge.svg?branch=v9&service=github)](https://coveralls.io/github/go-playground/validator?branch=v9)
4+
![Project status](https://img.shields.io/badge/version-10.0.0-green.svg)
5+
[![Build Status](https://travis-ci.org/go-playground/validator.svg?branch=master)](https://travis-ci.org/go-playground/validator)
6+
[![Coverage Status](https://coveralls.io/repos/go-playground/validator/badge.svg?branch=master&service=github)](https://coveralls.io/github/go-playground/validator?branch=master)
77
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/validator)](https://goreportcard.com/report/github.com/go-playground/validator)
8-
[![GoDoc](https://godoc.org/gopkg.in/go-playground/validator.v9?status.svg)](https://godoc.org/gopkg.in/go-playground/validator.v9)
8+
[![GoDoc](https://godoc.org/github.com/go-playground/validator?status.svg)](https://godoc.org/github.com/go-playground/validator)
99
![License](https://img.shields.io/dub/l/vibe-d.svg)
1010

1111
Package validator implements value validations for structs and individual fields based on tags.
@@ -20,18 +20,18 @@ It has the following **unique** features:
2020
- Alias validation tags, which allows for mapping of several validations to a single tag for easier defining of validations on structs
2121
- 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
2222
- Customizable i18n aware error messages.
23-
- 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)
23+
- 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)
2424

2525
Installation
2626
------------
2727

2828
Use go get.
2929

30-
go get gopkg.in/go-playground/validator.v9
30+
go get github.com/go-playground/validator/v10
3131

3232
Then import the validator package into your own code.
3333

34-
import "gopkg.in/go-playground/validator.v9"
34+
import "github.com/go-playground/validator/v10"
3535

3636
Error Return Value
3737
-------
@@ -53,14 +53,14 @@ validationErrors := err.(validator.ValidationErrors)
5353
Usage and documentation
5454
------
5555

56-
Please see http://godoc.org/gopkg.in/go-playground/validator.v9 for detailed usage docs.
56+
Please see http://godoc.org/github.com/go-playground/validator/v10 for detailed usage docs.
5757

5858
##### Examples:
5959

60-
- [Simple](https://github.com/go-playground/validator/blob/v9/_examples/simple/main.go)
61-
- [Custom Field Types](https://github.com/go-playground/validator/blob/v9/_examples/custom/main.go)
62-
- [Struct Level](https://github.com/go-playground/validator/blob/v9/_examples/struct-level/main.go)
63-
- [Translations & Custom Errors](https://github.com/go-playground/validator/blob/v9/_examples/translations/main.go)
60+
- [Simple](https://github.com/go-playground/validator/blob/master/_examples/simple/main.go)
61+
- [Custom Field Types](https://github.com/go-playground/validator/blob/master/_examples/custom/main.go)
62+
- [Struct Level](https://github.com/go-playground/validator/blob/master/_examples/struct-level/main.go)
63+
- [Translations & Custom Errors](https://github.com/go-playground/validator/blob/master/_examples/translations/main.go)
6464
- [Gin upgrade and/or override validator](https://github.com/go-playground/validator/tree/v9/_examples/gin-upgrading-overriding)
6565
- [wash - an example application putting it all together](https://github.com/bluesuncorp/wash)
6666

_examples/custom-validation/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"gopkg.in/go-playground/validator.v9"
6+
"github.com/go-playground/validator/v10"
77
)
88

99
// MyStruct ..

_examples/custom/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77
"reflect"
88

9-
"gopkg.in/go-playground/validator.v9"
9+
"github.com/go-playground/validator/v10"
1010
)
1111

1212
// DbBackedUser User struct

_examples/dive/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"gopkg.in/go-playground/validator.v9"
6+
"github.com/go-playground/validator/v10"
77
)
88

99
// Test ...

_examples/gin-upgrading-overriding/v8_to_v9.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"sync"
66

77
"github.com/gin-gonic/gin/binding"
8-
"gopkg.in/go-playground/validator.v9"
8+
"github.com/go-playground/validator/v10"
99
)
1010

1111
type defaultValidator struct {

_examples/simple/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"gopkg.in/go-playground/validator.v9"
6+
"github.com/go-playground/validator/v10"
77
)
88

99
// User contains user information

_examples/struct-level/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"gopkg.in/go-playground/validator.v9"
6+
"github.com/go-playground/validator/v10"
77
)
88

99
// User contains user information

_examples/translations/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55

66
"github.com/go-playground/locales/en"
77
ut "github.com/go-playground/universal-translator"
8-
"gopkg.in/go-playground/validator.v9"
9-
en_translations "gopkg.in/go-playground/validator.v9/translations/en"
8+
"github.com/go-playground/validator/v10"
9+
en_translations "github.com/go-playground/validator/v10/translations/en"
1010
)
1111

1212
// User contains user information

0 commit comments

Comments
 (0)