This code looks pretty much identical to the code I use to consume a rather complex json file, but I would try to add the title and body_html elements to the Product struct to see if that makes a difference (it shouldn’t though, I don’t consume all elements in my code either). Also print the string JSONProducts to make sure that string contains what you expect.
type Product struct {
Id string `json:"id"`
Title `json:"title"`
BodyHtml `json:"body_html"
}
Since the id property in your JSON input is a JSON number, you can’t unmarshal it as a Go string. Change the type of Id to int64 and add the two other properties:
type Product struct {
Id int64 `json:"id"`
Title string `json:"title"`
Body string `json:"body_html"`
}