Cannot install Go SDK

When I run go get github.com/couchbase/gocb/v2@v2.1.1
(Per: https://docs.couchbase.com/go-sdk/current/hello-world/start-using-sdk.html)
I get an invalid path error:

package github.com/couchbase/gocb/v2@v2.1.1: invalid github.com/ import path “github.com/couchbase/gocb/v2@v2.1.1

(echo $GOPATH => /home/naftali/go
ls /home/naftali/go => bin pkg src)

I’ve also tried: go get github.com/couchbase/gocb

But get this:

go/src/github.com/couchbase/gocbcore/memd/uleb128.go:40:26: invalid operation: uint64(b[i] & 127) << (i * 7) (shift count type int, must be unsigned integer)

(I’m running Ubuntu 18.04.2 LTS)

Hey @naftali,

Can you share which version of Go you are using? It looks like Go is trying to use the old GOPATH method of installation as opposed to Go Modules, which typically happens when using older versions of Go.

Cheers, Brett

1 Like