ns1/ns1-go

stats.go example: json: cannot unmarshal array into Go value of type float32

Closed this issue · 0 comments

r0bj commented

stats.go example (https://github.com/ns1/ns1-go/blob/v2/rest/_examples/stats.go) fails with:

2022/07/07 19:49:33 go-ns1/2.6.5: GET https://api.nsone.net/v1/stats/qps
2022/07/07 19:49:33 json: cannot unmarshal array into Go value of type float32

API returns something like this:

{"networks":[{"network":0,"qps":106.125}],"qps":106.06666666666666}

However stat.go (https://github.com/ns1/ns1-go/blob/v2/rest/stat.go) probably expects something like this:

{"qps":105.01666666666667}