我正在尝试安装我的项目的依赖项,glide
但不幸的是它失败并显示以下消息:
main.go:7:2: cannot find package "github.com/arschles/go-in-5-minutes/episode13/models" in any of:
/Users/theo/go-workspace/src/github.com/thitami/go-in-5-minutes/episode13/vendor/github.com/arschles/go-in-5-minutes/episode13/models (vendor tree)
/usr/local/Cellar/go/1.8.3/libexec/src/github.com/arschles/go-in-5-minutes/episode13/models (from $GOROOT)
/Users/theo/go-workspace/src/github.com/arschles/go-in-5-minutes/episode13/models (from $GOPATH)
运行 a go env
,这是我感兴趣的环境变量:
GOPATH="/Users/theo/go-workspace"
GOROOT="/usr/local/Cellar/go/1.8.3/libexec"
请注意,我zsh
正在导出文件GOPATH
内部,.zshrc
如下所示:
export GOPATH=HOME/go-workspace
任何想法表示赞赏
* 更新 *
根据要求,这是调用models
包的一段代码:
import (
"database/sql"
"log"
"github.com/arschles/go-in-5-minutes/episode13/models"
_ "github.com/mxk/go-sqlite/sqlite3"
)