again some staticcheck
This commit is contained in:
parent
c98e0a52a2
commit
9c90f3e2d6
1 changed files with 1 additions and 3 deletions
|
@ -183,9 +183,7 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) {
|
||||||
c.Collect(ch2)
|
c.Collect(ch2)
|
||||||
close(ch2)
|
close(ch2)
|
||||||
}()
|
}()
|
||||||
metrics := make([]prometheus.Metric, 16)
|
|
||||||
for v := range ch2 {
|
for v := range ch2 {
|
||||||
metrics = append(metrics, v)
|
|
||||||
ch <- v.Desc()
|
ch <- v.Desc()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -578,7 +576,7 @@ func (c *Collector) collectConstWithFactor(ch chan<- prometheus.Metric, valueTyp
|
||||||
|
|
||||||
func (c *Collector) toString(i interface{}) string {
|
func (c *Collector) toString(i interface{}) string {
|
||||||
if val := reflect.ValueOf(i); val.Kind() == reflect.Ptr {
|
if val := reflect.ValueOf(i); val.Kind() == reflect.Ptr {
|
||||||
if val.IsNil() == false {
|
if !val.IsNil() {
|
||||||
return c.toString(val.Elem().Interface())
|
return c.toString(val.Elem().Interface())
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue