Open michaelriri opened 5 months ago
Can someone help my identify what's wrong with this? I'm trying to page through all the search results, but the loop never breaks:
ctx := context.Background() results, err := client.Search(ctx, "lofi", spotify.SearchTypeTrack|spotify.SearchTypeAlbum|spotify.SearchTypeArtist, spotify.Limit(50)) if err != nil { log.Fatal(err) } for { err = client.NextTrackResults(ctx, results) if err == spotify.ErrNoMorePages { break } if err != nil { log.Fatal(err) } }
This loop runs infinitely where SearchResult.Tracks.Next stays locked at https://api.spotify.com/v1/search?query=lofi&type=track&offset=950&limit=50.
SearchResult.Tracks.Next
https://api.spotify.com/v1/search?query=lofi&type=track&offset=950&limit=50
Am I doing something wrong here?
Can someone help my identify what's wrong with this? I'm trying to page through all the search results, but the loop never breaks:
This loop runs infinitely where
SearchResult.Tracks.Next
stays locked athttps://api.spotify.com/v1/search?query=lofi&type=track&offset=950&limit=50
.