metrics: fix issues reported by staticcheck (#20365)

This commit is contained in:
Guillaume Ballet
2019-11-22 16:04:35 +01:00
committed by Felix Lange
parent dd21f079e8
commit 58f2ce8671
15 changed files with 109 additions and 105 deletions

View File

@ -62,7 +62,7 @@ func InfluxDBWithTags(r metrics.Registry, d time.Duration, url, database, userna
func InfluxDBWithTagsOnce(r metrics.Registry, url, database, username, password, namespace string, tags map[string]string) error {
u, err := uurl.Parse(url)
if err != nil {
return fmt.Errorf("Unable to parse InfluxDB. url: %s, err: %v", url, err)
return fmt.Errorf("unable to parse InfluxDB. url: %s, err: %v", url, err)
}
rep := &reporter{
@ -76,11 +76,11 @@ func InfluxDBWithTagsOnce(r metrics.Registry, url, database, username, password,
cache: make(map[string]int64),
}
if err := rep.makeClient(); err != nil {
return fmt.Errorf("Unable to make InfluxDB client. err: %v", err)
return fmt.Errorf("unable to make InfluxDB client. err: %v", err)
}
if err := rep.send(); err != nil {
return fmt.Errorf("Unable to send to InfluxDB. err: %v", err)
return fmt.Errorf("unable to send to InfluxDB. err: %v", err)
}
return nil