ns1 / ns1-go

Golang API client for NS1
Apache License 2.0
34 stars 59 forks source link

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

Closed r0bj closed 2 years ago

r0bj commented 2 years ago

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}