For some reason, I want to build a go project (docker swarm) from source, following the official doc.
It works well if I do:
...
cd $GOPATH/src/github.com/docker/swarm
go install .
But it fails if I try to "one-line" it and avoid cd
:
go install $GOPATH/src/github.com/docker/swarm
ERROR: can't load package:
package <my go path>/src/github.com/docker/swarm:
import "<my go path>/src/github.com/docker/swarm":
cannot import absolute path
Why can't go deal with this absolute path?