influxdata / influxdb-client-go

InfluxDB 2 Go Client
MIT License
609 stars 116 forks source link

Update README.md #365

Closed xe-nvdk closed 1 year ago

xe-nvdk commented 2 years ago

I'm proposing the update command to install influxdb_client for go. With the command in the readme, the error is:

go get github.com/influxdata/influxdb-client-go/v2 go: go.mod file not found in current directory or any parent directory. 'go get' is no longer supported outside a module. To build and install a command, use 'go install' with a version, like 'go install example.com/cmd@latest' For more information, see https://golang.org/doc/go-get-install-deprecation or run 'go help get' or 'go help install'.

Closes #

Proposed Changes

This is the way of downloading an specific package:

go install github.com/influxdata/influxdb-client-go/v2@latest

Checklist

vlastahajek commented 2 years ago

Thanks for the PR. Actually, your fix is not right. You have the same problem as in the issue #233 and #260: your project is using Go path. The install procedure is correct. It is a installation guide for projects using Go modules:

  1. Add the client package your to your project dependencies (go.mod).
    go get github.com/influxdata/influxdb-client-go/v2
  2. Add import github.com/influxdata/influxdb-client-go/v2 to your source code.

I admit it should be more clearly marked it is for Go modules.

The right fix have to add the installation procedure for Go path based.

vlastahajek commented 1 year ago

Superseded by #366.