|
|
|
|
|
by mariusor
658 days ago
|
|
I'm using something like this in one of my Go projects and I created explicit functions to allow programmers to use the larger type where the smaller one is required, which is normally disallowed by the language, by employing some cludgy unsafe package use and based on the assumption that the memory layout for the two types looks identical for the common "a" and "b" properties. So far it hasn't bitten me in the behind, but I wouldn't advise anyone to use that logic for production code. |
|