我已经使用
在Windows中安装了一个包去获取github.com/couchbaselabs/go-couchbase
安装后没有消息可用。
然后我试着加入Go
import (
"github.com/couchbaselabs/go-couchbase"
)
但是,当我构建时,我收到了消息
main.go:7:2: cannot find package "github.com/couchbaselabs/go-couchbase" in any of:
c:\go\src\pkg\github.com\couchbaselabs\go-couchbase (from $GOROOT)
C:\Go\src\Chaatz\src\github.com\couchbaselabs\go-couchbase (from $GOPATH)
C:\Go\src\github.com\couchbaselabs\go-couchbase
我是否遗漏了某些内容,或者将软件包安装到其他路径?
答案 0 :(得分:1)
例如,
>set gopath
GOPATH=C:\gopath
>go get -v github.com/couchbaselabs/go-couchbase
github.com/couchbaselabs/go-couchbase (download)
github.com/couchbase/gomemcached (download)
github.com/couchbaselabs/retriever (download)
github.com/natefinch/npipe (download)
github.com/couchbase/gomemcached
github.com/couchbaselabs/retriever/lockfile
github.com/natefinch/npipe
github.com/couchbaselabs/retriever/logger
github.com/couchbaselabs/retriever/stats
github.com/couchbase/gomemcached/client
github.com/couchbaselabs/go-couchbase
>go version
go version go1.3 windows/amd64
>type cb.go
package main
import (
"fmt"
"github.com/couchbaselabs/go-couchbase"
)
func main() {
var _ couchbase.Bucket
fmt.Println("couchbase")
}
>go run cb.go
couchbase
>