-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ID and URI type aliases #173
Comments
Yes, but at that point why have a type at all? Might as well just accept strings in that case. The original motivation behind a distinct type for Spotify IDs is they are a specifically formatted string and it allows the type system to help distinguish where these IDs are required. |
yes, but you can pass a string implicitly to a function demanding a spotify.ID there is nothing here that protects you from passing badly formated strings |
it also means I have to write functions like:
Just to be able to use the function. |
Because ID and URI are not type aliases, you cannot automatically convert a []string of spotify ids into a []spotify.ID when calling functions like GetAlbums.
If they were defined as aliases, the type conversion would be automatic.
see here
The text was updated successfully, but these errors were encountered: