Thank you. That’s what I was looking for, I didn’t know it was added in 1.9.
Will checkout on 1.9. Thanks Rajesh Sent from my iPhone > On Feb 11, 2018, at 10:14 AM, Ian Lance Taylor <i...@golang.org> wrote: > >> On Sun, Feb 11, 2018 at 7:52 AM, rajesh nataraja <rnatar...@gmail.com> wrote: >> >> Yes I understand the strict type checking. But in the absence of macros, the >> code becomes extremely awkward and sometimes the simplicity that we beg for >> gets undermined. >> My intention trying to do this was two things: >> 1. Reduce my line length in the code >> 2. Avoid making changes to all parts of the code as I needed to use the same >> type in a different package. I could not make package inclusions without >> circular dependency. >> >> A dynamic check by compiler to see if the type has been really modified >> would be great. Like a pre processor check to simply replace the definitions >> with original names could do this? >> >> Any other way to achieve what I need? > > I don't know what you need, but Go permits explicit type conversions. > > x.b = T1(y) > > It also permits type aliases. > > type newt2 = a.T2 > > 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.