type resp struct {
R struct {
Items int `json:"items"`
}
}
type Resp struct {
R struct {
Max int `json:"max"`
Items []int `json:"items"`
} `json:"r"`
}
package main
import (
"encoding/json"
"fmt"
)
type Resp struct {
R struct {
Items []int
}
}
func main() {
response := []byte(`{"r":{"max":900,"items":[1,3,5,7,3,1,7]}}`)
r := Resp{}
json.Unmarshal(response, &r)
for i := range r.R.Items {
fmt.Println(i)
}
}