Trying to get influxdb/client work

Hi golangbridge community,

I have an issue with “github.com/influxdata/influxdb/client” that make me unable to launch go script.

I tried to get smokeping result in graphana by following this post :
https://hveem.no/visualizing-latency-variance-with-grafana

So I’ve install “go1.6.linux-amd64.tar.gz” then launching the command "go get -u “github.com/influxdb/influxdb/client” but so far i get this error :
infping.go:4:5: code in directory /usr/local/go/src/github.com/influxdb/influxdb/client expects import “github.com/influxdata/influxdb/client

Is anyone can help me ?

I’ve only quickly taken a look at this and am not a veteran my self (just learning).
(Heads up: the spaces in the paths are only so the forum formats the important bits, please ignore them)

But to me it looks like you go get
github.com/ influxdb/influxdb/client

which Github redirects to
github.com/ influxdata/influxdb/client

(don’t ask me why, im not that familiar with github either) but go get happily stores it in
GOPATH/github.com/ influxdb/influxdb/client

which would then be used for import paths (in your infping.go it imports influxdb).

The problem then is that influxdb_test.go and example_test.go in the influxdb package imports influxdata because that’s what it expects since that’s the “real” URL. This import path obviously doesn’t exist (because you imported into influxdb) and the compiler gives you an error.

My suggestion would be to change the path on your machine to
GOPATH/github.com/ influxdata/influxdb/client

and change the import path in your infping.go to

"github.com/influxdata/influxdb/client"

And see if that works. If it does, I probably was right, if not, forget what i said :slight_smile:

Thanks a lot your suggestion seems to work ! :smile:

Hey, can you please post the exact commands you used to solve this?

Hi,

It’s up than a month a I don’t remember perfectly, but I think I’ve did this :

cp github.com/influxdb/influxdb github.com/influxdata/influxdb

and edit my go script :

  • "github.com/influxdb/influxdb/client"
    

After this few modifications, I was able to launch my script …

Hope it’s helping you.

1 Like

It helps indeed, thanks! :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.