Update Client documentation

* Added additional variable to fulfil NewUDPClient function requirement (there was one instead of 2) and it caused multiple-value client.NewUDPClient() in single-value context error

* Update README.md

Added error handling.
pull/7637/head
DanKans 2016-12-01 18:18:28 +00:00 committed by Edd Robinson
parent 7106c8a9c9
commit e0291e419b
1 changed files with 5 additions and 2 deletions

View File

@ -230,7 +230,10 @@ The **InfluxDB** client also supports writing over UDP.
```go ```go
func WriteUDP() { func WriteUDP() {
// Make client // Make client
c := client.NewUDPClient("localhost:8089") c, err := client.NewUDPClient("localhost:8089")
if err != nil {
panic(err.Error())
}
// Create a new point batch // Create a new point batch
bp, _ := client.NewBatchPoints(client.BatchPointsConfig{ bp, _ := client.NewBatchPoints(client.BatchPointsConfig{