segmentio / stats

Go package for abstracting stats collection
https://godoc.org/github.com/segmentio/stats
MIT License
208 stars 32 forks source link

Fix use of reflect.StringHeader in prometheus/metric.go #133

Closed bhavanki closed 3 years ago

bhavanki commented 3 years ago

The go vet command in Go 1.16 reports a warning for inappropriate use of reflect.StringHeader.

https://github.com/golang/go/issues/40701

Its use in prometheus/metric.go to convert a byte array to a string in place began to trigger the warning. That code has been replaced with a safer variant that avoids the vet warning and still converts the array without allocating new memory.

https://stackoverflow.com/a/66865482

bhavanki commented 3 years ago

The additional commit here gets CircleCI testing for the influxdb part of this library working again.

bhavanki commented 3 years ago

LGTM! thanks for adding these tests as well :)

Credit to @collinvandyck for that!