On Thu, Jun 8, 2017 at 9:15 AM, Alessandro Re <akirosspo...@gmail.com> wrote:
>
> I was wondering if it is useful to redefine basic data types, for example
>
> type int int32
>
> or, as in my case that I am dealing with CGO
>
> type int C.int

Yes, although it will only affect the package being compiled.


> Besides being possible, and probably not really practical, is it safe? Are
> there any practical use cases where redefining some basic data types can be
> a good idea?

It is safe.  But it is likely to be confusing for any readers.  And it
can make it hard to call other packages that use a different
definition of `int`.  So I'd have to say that this is never practical.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to