I developed one go service and deployed it on GAE. At the time of developing this application, I included required go modules using command in my work machine-
go get -u <module-name>
I am able to include other required go modules using following commands -
adtech-adlib-web> go mod init
It created one go.mod file with message-
go: creating new go.mod: module github.com/nytm/adtech-adlib-web
than, I executed below command to download required modules in vendor folder as-
adtech-adlib-web> go mod vendor
Now, I want to commit this go code in my feature branch where code automatically deploys through .drone.io tool in repository. However, my build gets failed with only error :
cannot find package "backend" in any of:
/drone/src/github.com/nytm/adtech-adlib-web/vendor/backend (vendor tree)
/usr/local/go/src/backend (from $GOROOT)
/drone/src/backend (from $GOPATH)
In my .drone.yml file section which creates problem is -
backend-test:
image: jprobinson/golang-gcloud-sdk:1.11
environment:
- GOPATH=/drone
- PATH=/bin:/usr/bin:/usr/local/go/bin:/usr/local/go_appengine
commands:
- go test -v ./backend/...
when:
event: [push, pull_request]
I don't know how to resolve this problem? If go mod vendor can help in this case, how to use it and at which folder level I would have to execute this? Please explain all steps to perform.