Update client README - close client resources

pull/9710/head
Jan Garaj 2018-04-12 18:24:42 +01:00 committed by Jan Garaj
parent 10a7ffb647
commit fd3156e4c1
1 changed files with 7 additions and 1 deletions

View File

@ -72,7 +72,8 @@ func main() {
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
defer c.Close()
// Create a new point batch // Create a new point batch
bp, err := client.NewBatchPoints(client.BatchPointsConfig{ bp, err := client.NewBatchPoints(client.BatchPointsConfig{
Database: MyDB, Database: MyDB,
@ -100,6 +101,11 @@ func main() {
if err := c.Write(bp); err != nil { if err := c.Write(bp); err != nil {
log.Fatal(err) log.Fatal(err)
} }
// Close client resources
if err := c.Close(); err != nil {
log.Fatal(err)
}
} }
``` ```