3 ms·
No, it's not an alias, they are distinct types. You can't use the types interchangeably (unless you cast them). Your playground example didn't try to pass a U
by lentil 6y ago
No, it's not an alias, they are distinct types. You can't use the types interchangeably (unless you cast them).
Your playground example didn't try to pass a UserID to a function accepting a PostID, but if you do that, you'll see the error:
https://play.golang.org/p/vyiJ_sLzy4O https://play.golang.org/p/vyiJ_sLzy4O