Open leica19 opened 4 years ago
the run command I use in Dockerfile is below.
RUN go get -u gopkg.in/go-playground/validator.v9
hello. i have error in v10 vendor/utils/validator.go:27:52: cannot use Validate (type *"gopkg.in/go-playground/validator.v10".Validate) as type *"github.com/go-playground/validator".Validate in argument to "gopkg.in/go-playground/validator.v10/translations/en".RegisterDefaultTranslations
see #549 , think it's fixed on v9.30.2
@deankarn thank you so much. i'll try the new ver.
Please let me know if it’s all good now :)
still failing for me when validator is depended by gin
$ go get github.com/go-playground/validator/v10
package github.com/go-playground/validator/v10: cannot find package "github.com/go-playground/validator/v10" in any of:
/usr/local/Cellar/go/1.13.3/libexec/src/github.com/go-playground/validator/v10 (from $GOROOT)
/Users/lethe/work/go/src/github.com/go-playground/validator/v10 (from $GOPATH)
still failing for me when validator is depended by gin
$ go get github.com/go-playground/validator/v10 package github.com/go-playground/validator/v10: cannot find package "github.com/go-playground/validator/v10" in any of: /usr/local/Cellar/go/1.13.3/libexec/src/github.com/go-playground/validator/v10 (from $GOROOT) /Users/lethe/work/go/src/github.com/go-playground/validator/v10 (from $GOPATH)
i got the same error MacBook-Pro-3:go-playground zhuchuanyun$ go get github.com/go-playground/validator/v10 package github.com/go-playground/validator/v10: cannot find package "github.com/go-playground/validator/v10" in any of: /Volumes/NVME/usr/go/src/github.com/go-playground/validator/v10 (from $GOROOT) /Volumes/NVME/usr/golang/src/github.com/go-playground/validator/v10 (from $GOPATH)
Any updates on this? This is a blocker because the docker builds are failing for us. Please help
Any updates on this? This is a blocker because the docker builds are failing for us. Please help
I
still failing for me when validator is depended by gin
$ go get github.com/go-playground/validator/v10 package github.com/go-playground/validator/v10: cannot find package "github.com/go-playground/validator/v10" in any of: /usr/local/Cellar/go/1.13.3/libexec/src/github.com/go-playground/validator/v10 (from $GOROOT) /Users/lethe/work/go/src/github.com/go-playground/validator/v10 (from $GOPATH)
i got the same error MacBook-Pro-3:go-playground zhuchuanyun$ go get github.com/go-playground/validator/v10 package github.com/go-playground/validator/v10: cannot find package "github.com/go-playground/validator/v10" in any of: /Volumes/NVME/usr/go/src/github.com/go-playground/validator/v10 (from $GOROOT) /Volumes/NVME/usr/golang/src/github.com/go-playground/validator/v10 (from $GOPATH)
There's something wrong with this library , if you "go get" or "govendor fetch" the latest version, there is still not a folder named "v10" or it is empty, so you have to do it manually: $go get "gopkg.in/go-playground/validator.v10" $mkdir -p $GOPATH/src/vendor/github.com/go-playground/validator/v10 $cp -rf $GOPATH/src/gopkg.in/go-playground/validator.v10/* $GOPATH/src/vendor/github.com/go-playground/validator/v10
@laoluotuo are you using go modules? I ask because you mentioned using govendor.
The path with the v10 suffix won’t work with pre-existing tooling prior to go modules, but you should be able to drop the suffix if that’s the case.
@laoluotuo are you using go modules? I ask because you mentioned using govendor.
The path with the v10 suffix won’t work with pre-existing tooling prior to go modules, but you should be able to drop the suffix if that’s the case.
I'm only using govendor
Try these. It worked in my case.
$ sudo add-apt-repository ppa:longsleep/golang-backports $ sudo apt-get update $ sudo apt-get install golang-go
still getting same error
Hey all, I've had to explain this a few times, go modules has fractured the community pretty hard.
gopkg.in/go-playground/validator.v10
is NOT a valid import path❗️
v10
was the changeover from using gopkg.in
to go modules
for versioning. If you are not on go modules, stick with gopkg.in/go-playground/validator.v9
, if you're using go modules, update to using github.com/go-playground/validator/v10
.
I encourage everyone to update to using Go Modules to help resolve the bad state the community is in where much of the old versioning tooling is not compatible with the new Go Modules.
Package version eg. v8, v9:
v9
Issue, Question or Enhancement:
how should I fix the error as in the title.
Code sample, to showcase or reproduce:
the app container logs below:
when I attach the container and check the import sentences, it, indeed, imports "github.com/go-playground/validator/v10"