0

I cannot install bleve as it complains about zap:

go get github.com/blevesearch/bleve/...

package github.com/blevesearch/zap/v11: cannot find package "github.com/blevesearch/zap/v11" in any of:
    /usr/local/go/src/github.com/blevesearch/zap/v11 (from $GOROOT)
    /home/w/go/src/github.com/blevesearch/zap/v11 (from $GOPATH)
package github.com/blevesearch/zap/v12: cannot find package "github.com/blevesearch/zap/v12" in any of:
    /usr/local/go/src/github.com/blevesearch/zap/v12 (from $GOROOT)
    /home/w/go/src/github.com/blevesearch/zap/v12 (from $GOPATH)
package github.com/blevesearch/zap/v13: cannot find package "github.com/blevesearch/zap/v13" in any of:
    /usr/local/go/src/github.com/blevesearch/zap/v13 (from $GOROOT)
    /home/w/go/src/github.com/blevesearch/zap/v13 (from $GOPATH)

I can fetch it via gopkg.in/blevesearch/zap.v13, but bleve itself is referencing this. My GOPATH is unset.

go env:

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/w/.cache/go-build"
GOENV="/home/w/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="freebsd"
GOPATH="/home/w/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build443146450=/tmp/go-build -gno-record-gcc-switches"
Walter
  • 1,290
  • 2
  • 21
  • 46
  • Without a [mre] we can only guess. Are you using a current version of Go? What is the output of `go env`? – JimB Jul 17 '20 at 17:37
  • What's your go version? Do you use go module and what does it look like if you use it? – hyz Jul 19 '20 at 09:34
  • I am using go 1.14.6 on FreeBSD. I believe bleve uses go modules. I would think my environment might not be right since this is a fairly popular project ... – Walter Jul 19 '20 at 15:39

1 Answers1

0

I was having the same problem and found that bleve now requires using of Go modules to be enabled. I see, in your env, that Go module (GO111MODULE) is not enabled. You need to enable Go module by adding this line in your .bashrc (or equivalent) file.

export GO111MODULE=on

Or you can use it directly in command when installing bleve.

GO111MODULE="on" go get -u github.com/blevesearch/bleve/...

But, if you use it in command line and do not put in your .bashrc file, you may need to use it when go run or go build. So it will be helpful to add it to .bashrc.

For more information, check out this RFC.

Arka Roy
  • 170
  • 3
  • 15