0

我使用go version go1.10.3 darwin/amd64glide version v0.13.1 项目位于,/Users/robopuff/Development/GoRethink它的树看起来像这样:

.
├── glide.lock
├── glide.yaml
├── main.go
├── rethinkdb_data
│   ├── 001fbc34-bd63-445f-8590-709ac7475294
│   ├── log_file
│   ├── metadata
│   └── tmp
└── vendor
    ├── github.com
    │   ├── cenkalti
    │   │   └── backoff
    │   ├── golang
    │   │   └── protobuf
    │   ├── hailocab
    │   │   └── go-hostpool
    │   ├── opentracing
    │   │   └── opentracing-go
    │   └── sirupsen
    │       └── logrus
    ├── golang.org
    │   └── x
    │       ├── crypto
    │       ├── net
    │       └── sys
    └── gopkg.in
        ├── fatih
        │   └── pool.v2
        └── gorethink
            └── gorethink.v4

运行后,go run main.go我受到错误欢迎

❯ go run main.go
main.go:7:2: cannot find package "gopkg.in/gorethink/gorethink.v4" in any of:
    /usr/local/go/src/gopkg.in/gorethink/gorethink.v4 (from $GOROOT)
    /Users/robopuff/go/src/gopkg.in/gorethink/gorethink.v4 (from $GOPATH)

编译器不应该首先查看vendor吗?

4

1 回答 1

-1

正确的答案是通读Docs,尤其是Workspaces并理解它。

于 2018-08-09T09:26:58.297 回答