influxdata / influxdb1-client

The old clientv2 for InfluxDB 1.x
MIT License
190 stars 111 forks source link

go run: cannot run *_test.go files (example_test.go) #21

Open Whishay opened 4 years ago

Whishay commented 4 years ago

a 10-min newbee with go on Fedora30.

docker exec -it 2256747aa0e2 influx

Connected to http://localhost:8086 version 1.7.8 InfluxDB shell version: 1.7.8

go version

go version go1.12.9 linux/amd64

go run influxdb.go

influxdb.go:22:2: cannot find package "github.com/influxdata/influxdb1-client/models" in any of: /usr/lib/golang/src/github.com/influxdata/influxdb1-client/models (from $GOROOT) /root/go/src/github.com/influxdata/influxdb1-client/models (from $GOPATH)

go run example_test.go

go run: cannot run *_test.go files (example_test.go)

sam-the-programmer commented 2 years ago

https://stackoverflow.com/questions/35099417/go-not-running-program-with-name-package-test-go You may need to build them

sam-the-programmer commented 2 years ago

Sorry, that was wrong. You need to use go test

sam-the-programmer commented 2 years ago

Can this be closed?