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

Build failing on Travis CI with go-playground #34

Closed
iomz opened this issue Feb 8, 2020 · 3 comments · Fixed by #35
Closed

Build failing on Travis CI with go-playground #34

iomz opened this issue Feb 8, 2020 · 3 comments · Fixed by #35
Assignees
Labels

Comments

@iomz
Copy link
Owner

iomz commented Feb 8, 2020

"go get -v -t ./..." failed. It couldn't resolve the dependency?

@iomz iomz added the bug label Feb 8, 2020
@iomz iomz self-assigned this Feb 8, 2020
@HanYangZhao
Copy link

I've recently have had the same problem. It comes down to a dependency failure : cannot find package "github.com/go-playground/validator/v10" in any of. It happens when you do ``dep ensure``` as well

This problem has been asked in here. It looks like some kind of issues between dep and go modules, which are incompatible I assume.

I have managed to install the program by ditching dep completely and switching to go modules. You can find a tutorial here. You would Go 1.11+.

TL;DR
This method works with Go 1.11, 1.12, and should work with every 1.X future release.

  • move your code outside of GOPATH
  • go mod init [module path]: this will import dependencies from Gopkg.lock.
  • go mod tidy: this will remove unnecessary imports, and add indirect ones.
  • rm -fr vendor/
  • go build: is everthing ok?
  • rm -f Gopkg.lock Gopkg.toml
  • git commit -m 'chore(dep): migrated from dep to Go 1.11 modules'

To install the program in the future, you would just do go build

I would do a pull request, but I'm not sure about your Go setup

@iomz
Copy link
Owner Author

iomz commented Apr 28, 2020

Thanks a bunch for the workaround. I'll take a look.

@iomz
Copy link
Owner Author

iomz commented Apr 28, 2020

@HanYangZhao Thanks! It's resolved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants