zmb3 / spotify

A Go wrapper for the Spotify Web API
Apache License 2.0
1.38k stars 291 forks source link

Unsure How To Provide spotify.ID to GetPlaylistTracks() #139

Closed cofonseca closed 3 years ago

cofonseca commented 3 years ago

Sorry for posting this here - this isn't really a bug, just more of a question. I'm fairly new to Go and am working with this library for the first time (it seems great, btw!), and I want to simply return all of the tracks in a playlist. I've successfully created a client with my OAuth info - no issues there.

I'm trying to run client.GetPlaylistTracks(), which takes in a playlist ID of type spotify.ID, which seems to be a string under the hood, but I can't seem to figure out how to create a spotify.ID, and GetPlaylistTracks() won't accept a simple string.

The only example I could find was the test for GetPlaylistOpt(), which looks like it just takes in a string, so I'm not sure why that doesn't work for me. Could someone please provide (or point me to) an example of how to create a spotify.ID object to be used by GetPlaylistTracks()?

Thanks in advance!

zmb3 commented 3 years ago

spotify.ID(“foo”) should do the trick 🙂

cofonseca commented 3 years ago

@zmb3 oh boy, not sure how I didn't realize that sooner... thank you very much! That worked beautifully. 🙂