Cannot install docker pkg dependency in Go

I’m trying to use the docker package in one of my Go applications. I’m importing the package as import "github.com/dotcloud/docker" in my script. But when trying to build the dependencies, that is, when I run go get in my project directory, it says:

foo.go:9:2: no buildable Go source files in /home/neville/gocode/src/github.com/dotcloud/docker

Here, my GOPATH is set to /home/neville/gocode, so when doing go get, the package should get downloaded to /home/neville/gocode/pkg, instead of /home/neville/gocode/src. What am I missing here?

  • Does using a Docker significantly improve the IO and processing speed?
  • Run Chromium inside container: libGl error
  • Deploy Ansible project which include a docker-compose.yml
  • Docker unable to start
  • /bin/sh: 1: gvm: not found
  • Travis-CI: docker image as build environment
  • Postgres on Docker. How can I create a database and a user?
  • Docker Hub timeout in automated build
  • Docker compose up fails with `require': cannot load such file — rack/handler/rails (LoadError)
  • Dockerfile unable to resolve host github with “go get”
  • Docker Compose Overriding
  • Running Jenkins slave on different OS than master (and host)
  • One Solution collect form web for “Cannot install docker pkg dependency in Go”

    github.com/dotcloud/docker isn’t a Go package, and that’s why there are no source files in that directory.

    Import the package you want directly, like so for the registry package:

    import "github.com/dotcloud/docker/registry"
    

    Also, go get does download into $GOPATH/src. The installed object files go in $GOPATH/pkg.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.