json: cannot unmarshal number into Go struct field Segment.segments.id of type string
alexflint opened this issue · comments
Looks like mailchimp API is serving integer tag IDs, and gochimp3 is using strings to represent tag IDs. To reproduce:
mailchimp := gochimp3.New(os.Getenv("MAILCHIMP_API_KEY"))
list, err := mailchimp.GetList(mailchimpAudienceID, nil)
if err != nil {
return err
}
segments, err := list.GetSegments(&gochimp3.SegmentQueryParams{})
if err != nil {
return err
}
for _, seg := range segments.Segments {
log.Println(seg.ID, seg.Name)
}
return nil
Output is:
json: cannot unmarshal number into Go struct field Segment.segments.id of type string