I am trying to import "github.com/couchbaselabs/go-couchbase", however the LiteIDE saids:
cannot find package "github.com/couchbaselabs/go-couchbase" in any of:
/usr/lib/go/src/pkg/github.com/couchbaselabs/go-couchbase (from $GOROOT)
/home/peter/gosrc/src/test_program/src/github.com/couchbaselabs/go-couchbase(from GOPATH)
Here is my code:
import (
"encoding/json"
"fmt"
"github.com/couchbaselabs/go-couchbase"
)
So what is the possible reason? I have set the custom directory to /home/peter/gosrc/src/test_program.
You should first use the "go get" command to fetch the source of the files and install them into your GOPATH directory because go-couchbase is a remote package and it is not yet present in your system.
' go get github.com/couchbaselabs/go-couchbase '
This is an article on the official golang website which explains how to get remote packages http://golang.org/doc/code.html#remote.
You can also read more about the go commands such as "go get" or "go test" here.