Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot use "go.uber.org/zap".Error(err) (type "go.uber.org/zap/zapcore".Field) #21

Open
dallanic opened this issue Jan 15, 2019 · 2 comments

Comments

@dallanic
Copy link

Operating System: Red Hat Enterprise Linux Server 7.5 (Maipo)
go version go1.10.3 linux/amd64

I am trying to build but got the following error :

building prometheus-es-adapter nil
GOPATH=/app/list/data/prometheus-es-adapter-master
go build -ldflags "-X main.GitCommit=17483d1adb607e642c0c09dc34a477e028a57a56+CHANGES -X main.VersionPrerelease=DEV" -o bin/prometheus-es-adapter cmd/adapter/*.go

command-line-arguments

cmd/adapter/main.go:68:57: cannot use "go.uber.org/zap".Error(err) (type "go.uber.org/zap/zapcore".Field) as type "github.com/pwillie/prometheus-es-adapter/vendor/go.uber.org/zap/zapcore".Field in argument to log.Fatal
cmd/adapter/main.go:80:40: cannot use client (type *"gopkg.in/olivere/elastic.v6".Client) as type *"github.com/pwillie/prometheus-es-adapter/vendor/gopkg.in/olivere/elastic.v6".Client in argument to elasticsearch.NewIndexService
cmd/adapter/main.go:82:50: cannot use "go.uber.org/zap".Error(err) (type "go.uber.org/zap/zapcore".Field) as type "github.com/pwillie/prometheus-es-adapter/vendor/go.uber.org/zap/zapcore".Field in argument to log.Fatal
cmd/adapter/main.go:89:41: cannot use client (type *"gopkg.in/olivere/elastic.v6".Client) as type *"github.com/pwillie/prometheus-es-adapter/vendor/gopkg.in/olivere/elastic.v6".Client in argument to elasticsearch.NewReadService
cmd/adapter/main.go:99:48: cannot use client (type *"gopkg.in/olivere/elastic.v6".Client) as type *"github.com/pwillie/prometheus-es-adapter/vendor/gopkg.in/olivere/elastic.v6".Client in argument to elasticsearch.NewWriteService
cmd/adapter/main.go:101:65: cannot use "go.uber.org/zap".Error(err) (type "go.uber.org/zap/zapcore".Field) as type "github.com/pwillie/prometheus-es-adapter/vendor/go.uber.org/zap/zapcore".Field in argument to log.Fatal
cmd/adapter/main.go:106:57: cannot use client (type *"gopkg.in/olivere/elastic.v6".Client) as type *"github.com/pwillie/prometheus-es-adapter/vendor/gopkg.in/olivere/elastic.v6".Client in argument to "github.com/pwillie/prometheus-es-adapter/pkg/handlers".NewAdminRouter
make: *** [build] Error 2

Thanks for your help on that issue.

@pwillie
Copy link
Owner

pwillie commented Jan 21, 2019

Hi Daniel,

I don't use RHEL and have been unable to reproduce your issue but looking at your details I would guess that your GOPATH is incorrect.

To build using Golang 1.10 using docker you can use something like:

  • checkout the repo
  • cd to the root of the repo
  • run a command similar to the following
docker run --rm -ti -v $PWD:/go/src/github.com/pwillie/prometheus-es-adapter -w /go/src/github.com/pwillie/prometheus-es-adapter golang:1.10-stretch make build

This will mount the current directory into the docker container within the GOPATH. The built binary will be available at ./bin/

@dallanic
Copy link
Author

Hi Peter,

Thanks for those elements, I will look into fixing the GOPATH problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants