0

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.

  1. What version of Delve are you using (dlv version)? dlv1.1.0
  2. What version of Go are you using? (go version)? go1.9.2
  3. What operating system and processor architecture are you using? Docker 18.06.1-ce in Mint 19
  4. What did you do? dlv debug src/cmd/project/main.go-l 0.0.0.0:2345 --headless=true --log=true -- server
  5. What did you expect to see? Delve running
  6. 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

  7. 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
Trody
  • 403
  • 5
  • 17
  • 1
    go to the project's git directory and run `go build`, it will fetch missing dependencies. – nilsocket Sep 01 '18 at 11:31
  • I'm not sure what do you mean. The project itself builds with gb. Honestly I'm not sure if it's even possible to do go build. The project folders are: /app, /bin, /pkg, /src, /vendor. Main is in ./src/cmd/microlab/main.go – Trody Sep 01 '18 at 13:30

0 Answers0