influxdata / influxdata/influxdb1-client

Cannot find module for path github.com/influxdata/influxdb1-client/v2

Open
#5 6 comments 6 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
192
Forks
109
PR merge metrics
No merged PRs in 30d

Description

Trying to build a go module (using go 1.11) with the InfluxDB client imported throws an error. Here is a snippet to reproduce this:

```
package main // import "github.com/user/influx"

import "github.com/influxdata/influxdb1-client/v2"

func main() {
// Do anything with the library
client.NewHTTPClient(client.HTTPConfig{})
}
```

Building without modules succeeds:
```
ak@zonda:/tmp/influx$ go build
ak@zonda:/tmp/influx$ ll
total 6404
drwxrwxr-x 2 ak ak 4096 Jan 24 19:59 ./
drwxrwxrwt 25 root root 16384 Jan 24 19:59 ../
-rwxrwxr-x 1 ak ak 6531840 Jan 24 19:59 influx*
-rw-rw-r-- 1 ak ak 191 Jan 24 19:56 main.go
```

Trying to build a module fails:
```
ak@zonda:/tmp/influx$ go mod init
go: creating new go.mod: module github.com/user/influx
ak@zonda:/tmp/influx$ go build
go: finding github.com/influxdata/influxdb1-client/v2 latest
go: downloading github.com/influxdata/influxdb1-client/v2 v2.0.0-20190118215656-f8cdb5d5f175
build github.com/user/influx: cannot find module for path github.com/influxdata/influxdb1-client/v2
```

Any tips? Thanks in advance!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure with the Go 1.11 module commands and the import path shown in the issue. Compare the successful non-module build with the failing module build; done means the sample module can resolve the client package and build successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.