Problem: I'm using gb to build the project. It recursively checks all folders to get vendor, external and main.go files. Delve doesn't do this so when I ssh into the docker image and try to run the dlv server on the root of the project it says that it cannot find go files. If I try with src/cmd/project/main.go it says it cannot find all the other packages.
- What version of Delve are you using (
dlv version
)? dlv1.1.0 - What version of Go are you using? (
go version
)? go1.9.2 - What operating system and processor architecture are you using? Docker 18.06.1-ce in Mint 19
- What did you do? dlv debug src/cmd/project/main.go-l 0.0.0.0:2345 --headless=true --log=true -- server
- What did you expect to see? Delve running
-
What did you see instead?
src/cmd/project/main.go:4:2: cannot find package "external/nexudus" in any of: /usr/local/go/src/external/nexudus (from $GOROOT) /go/src/external/nexudus (from $GOPATH) src/cmd/project/main.go:8:2: cannot find package "github.com/jinzhu/gorm" in any of: /usr/local/go/src/github.com/jinzhu/gorm (from $GOROOT) /go/src/github.com/jinzhu/gorm (from $GOPATH) src/cmd/project/main.go:9:2: cannot find package "gopkg.in/intercom/intercom-go.v2" in any of: /usr/local/go/src/gopkg.in/intercom/intercom-go.v2 (from $GOROOT) /go/src/gopkg.in/intercom/intercom-go.v2 (from $GOPATH) exit status 1
-
EXTRA My configuration file (docker/web-dev): ...
VOLUME /project/app/contracts
VOLUME /project/pkg
VOLUME /project/src
VOLUME /project/vendor
My docker-compose file:
web:
build: .
dockerfile: docker/web-dev
working_dir: /project
command: /go/bin/reflex --regex='\.go$$' --inverse-regex='_test\.go$$' --start-service -- sh -c 'gb build all && ./bin/project server'
ports:
- 6262:6262
volumes:
- ./pkg:/project/pkg
- ./src:/project/src
- ./vendor:/project/vendor
- ./app:/project/app
- ./app/contracts:/project/app/contracts