Peter Hon
Peter Hon

Reputation: 331

Go cannot find package in windows

I have installed a package in windows using

go get github.com/couchbaselabs/go-couchbase

No message apprear after installation.

Then I tried to include in Go

    import (
"github.com/couchbaselabs/go-couchbase"
)

However,when I build, I got the message

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

Am I miss something, or the package is installed to other path?

Upvotes: 4

Views: 4981

Answers (1)

peterSO
peterSO

Reputation: 166935

For example,

>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
>

Upvotes: 1

Related Questions