dep command did you run?````
~/gosdm630 $ go get -u github.com/golang/dep/cmd/dep
go: finding github.com/golang/dep/cmd/dep latest
go: finding github.com/golang/dep/cmd latest
../go/pkg/mod/github.com/golang/[email protected]/gps/constraint.go:149:4: undefined: semver.Constraint
````
I met the same error, have you found a solution of it ?
No :(
I think this has something to do with the new Go modules code? You can see semver.Constraint exists in github.com/golang/dep/vendor/github.com/Masterminds/semver/constraints.go so something must be happening for that file to not load correctly.
Can you try turning off Go modules support and seeing if this works?
FWIW, I can't reproduce this on either tip or Go 1.11.2.
Closing thin one as I've happily moved everything to modules. Thank you for the great support received here!
I met the same error.
but, I succeeded when GO111MODULE=on was changed to GO111MODULE=off.
Here's some digging from my encounter with this.
With modules on, go get picks up the latest tag for semver:
go: extracting github.com/Masterminds/vcs v1.13.0
go: finding github.com/golang/protobuf/proto latest
go: extracting github.com/Masterminds/semver v1.4.2
However, the vendored Masterminds is from branch 2.x. In the tagged v1.4.2, Constraint is private, in 2.x it's not. I'm not 100% sure how to fix this in my case, but leaving this here to potentially satisfy someone else's curiosity.
I fixed this by forcing semver to a particular (2.x) git commit:
go get github.com/Masterminds/semver@059deebd1619
Here's some digging from my encounter with this.
With modules on, go get picks up the latest tag for semver:go: extracting github.com/Masterminds/vcs v1.13.0 go: finding github.com/golang/protobuf/proto latest go: extracting github.com/Masterminds/semver v1.4.2However, the vendored Masterminds is from branch 2.x. In the tagged v1.4.2, Constraint is private, in 2.x it's not. I'm not 100% sure how to fix this in my case, but leaving this here to potentially satisfy someone else's curiosity.
Thank you for satisfying my curiosity lol
Most helpful comment
I met the same error.
but, I succeeded when
GO111MODULE=onwas changed toGO111MODULE=off.