cannot find package "github.com/go-playground/validator/v10"

github.com/go-playground/validator (download) package
github.com/go-playground/validator/v10: cannot find package
“github.com/go-playground/validator/v10” in any of

V8版本可如下处理:
gopkg.in/go-playground/validator.v8这个包,实际对应的就是github.com/go-playground/validator的v8分支,那么只要git clone -b v8 https://github.com/go-playground/validator.git就可以拉下来。重命名后,在mygin工程目录下的vendor文件夹中,按照gopkg.in/go-playground/validator.v8路径,放置第三方包。

V10版本按如下三步骤:
1、go get “gopkg.in/go-playground/validator.v10”
2、mkdir -p $GOPATH/src/vendor/github.com/go-playground/validator/v10
3、cp -rf $GOPATH/src/gopkg.in/go-playground/validator.v10/* $GOPATH/src/vendor/github.com/go-playground/validator/v10

你可能感兴趣的:(golang)