again some staticcheck

This commit is contained in:
Alexandre Blazart 2022-09-30 22:12:59 +02:00
parent c98e0a52a2
commit 9c90f3e2d6
No known key found for this signature in database
GPG Key ID: 7067AE298F0C655B

View File

@ -183,9 +183,7 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) {
c.Collect(ch2)
close(ch2)
}()
metrics := make([]prometheus.Metric, 16)
for v := range ch2 {
metrics = append(metrics, v)
ch <- v.Desc()
}
}
@ -578,7 +576,7 @@ func (c *Collector) collectConstWithFactor(ch chan<- prometheus.Metric, valueTyp
func (c *Collector) toString(i interface{}) string {
if val := reflect.ValueOf(i); val.Kind() == reflect.Ptr {
if val.IsNil() == false {
if !val.IsNil() {
return c.toString(val.Elem().Interface())
}
return ""