If the name of a package does not start with . or /, like “fmt” or “container/list”, Go looks for it inthe global Go tree. If it starts with ./ the package is searched in the actual directory; starting with /(even on Windows) it is searched for in the (absolute) path indicated.出自 The Way To Go按照我自己理解解释下:$GOROOT 系统中Go的根目录$GOPATH 用来安装第三方包的目录,自己随便指定例如,使用 go get xxx 安装的包会被放到 $GOPATH/src 下面对于自己写的模块,最简单的方式就是用相对或绝对路径导入如果想方便地在全局使用,像 "import "fmt" 一样推荐在$GOPATH/src下建立相应的package,当然放$GOROOT也是可以的