Go-micro: building error consul client type mismatch

Created on 19 Jun 2019  路  5Comments  路  Source: asim/go-micro

error logs: # github.com/micro/go-micro/registry/consul /go/src/github.com/micro/go-micro/registry/consul/watcher.go:47:33: cannot use cr.Client (type *"github.com/hashicorp/consul/api".Client) as type *"github.com/hashicorp/consul/vendor/github.com/hashicorp/consul/api".Client in argument to wp.RunWithClientAndLogger /go/src/github.com/micro/go-micro/registry/consul/watcher.go:212:37: cannot use cw.r.Client (type *"github.com/hashicorp/consul/api".Client) as type *"github.com/hashicorp/consul/vendor/github.com/hashicorp/consul/api".Client in argument to wp.RunWithClientAndLogger ERROR: Job failed: exit code 1

question wontfix

Most helpful comment

work arround by remove vendor dir:

rm -rf github.com/hashicorp/consul/vendor/

All 5 comments

I can reproduce this error as well

This is a hashicorp related issue where they continue to checkin the vendor dir. An issue should be filed with them as we have literally no way around this issue beyond dep pinning as far as I'm aware for which you should be using go.mod.

work arround by remove vendor dir:

rm -rf github.com/hashicorp/consul/vendor/

I'm also haveing the same issue here is the error log # github.com/micro/go-micro/registry/consul go/src/github.com/micro/go-micro/registry/consul/watcher.go:47:33: cannot use cr.Client (type *"github.com/hashicorp/consul/api".Client) as type *"github.com/hashicorp/consul/vendor/github.com/hashicorp/consul/api".Client in argument to wp.RunWithClientAndLogger go/src/github.com/micro/go-micro/registry/consul/watcher.go:212:37: cannot use cw.r.Client (type *"github.com/hashicorp/consul/api".Client) as type *"github.com/hashicorp/consul/vendor/github.com/hashicorp/consul/api".Client in argument to wp.RunWithClientAndLogger

Please use go modules. Otherwise delete the vendor directory or raise the issue with hashicorp.

Was this page helpful?
0 / 5 - 0 ratings