How can I print JSON? when I print I keep on getting random numbers in an array is there a way to print JSON instead of parsing it? Here's the function in the main.go
func sendpostget(word string) {
// Create a new spotify object
spot := spotify.New("number", "number")
// Authorize against Spotify first
authorized, _ := spot.Authorize()
if authorized {
// If we ere able to authorize then Get a simple album
// s := join("artists/", phone)
s := "artists/xxxx/albums?market=ES&limit=2"
fmt.Println(s)
response, _ := spot.Get(s, nil)
fmt.Println(response)
}
// Parse response to a JSON Object and
}
Here is the struct that I am using ( this get method will retrieve an artists' album from spotify API )
type Albums struct {
Albums []Album `json:"users"`
}
type Album struct {
AlbumType string `json:"album_type"`
Href string `json:"href"`
ID string `json:"id"`
}