InfluxDB client for Go


I already Googled to find answers related to the Go InfluxDB client. But I’m really confused as what to use as Go client. When trying to install the v2 ( gives problems/errors.

I found finally this: go get
Can someone confirm if installing this Go package is al I need to interface with an InfluxDB from Go?

Many thanks.

Thats correct. Here is a code snippet for how to connect to InfluxDB:

import (
client “GitHub - influxdata/influxdb1-client: The old clientv2 for InfluxDB 1.x

func establishInfluxConnection(username string, password string, databaseURL string) *client.Client {
host, err := url.Parse(databaseURL)
if err != nil {

conf := client.Config{
	URL:      *host,
	Username: username,
	Password: password,
con, err := client.NewClient(conf)
if err != nil {

return con


con := establishInfluxConnection(configuration.InfluxUsername, configuration.InfluxPassword, configuration.InfluxHost)