Thanks for pointing this out; I wasn't aware of this new syntax. I
think this gets to about halfway of what I'd hope for. That said, I'd
really like to avoid needing to jump through the hoop of indirection
for this. I occasionally find it hard to recognize what the type of a
thing is due to heavy use of type inference, so I'd hope for something
that doesn't require me to do additional backtracking to figure out
what the real underlying type is.

2018-02-22 12:31 GMT-08:00  <jake6...@gmail.com>:
> Have you considered using the new type alias feature introduced in 1.9? Line
> so:
>
> https://play.golang.org/p/6HK8qcuh9UU
>
> This would allow you to change the type of the map in a singe place (the
> type alias) and all the {} or make would adapt appropriately.
> Disclaimer: I am not espousing this style, just pointing out that it is
> possible.
>
>
>
> On Thursday, February 22, 2018 at 3:03:13 PM UTC-5, Devon H. O'Dell wrote:
>>
>> Hi all,
>>
>> It's been some time since I really contributed much of anything to the
>> project (sorry!), but after 8 years, I'm finally writing Go outside of
>> the project itself (and outside of porting efforts). I was lamenting
>> to some coworkers about the lack of a comparable feature to C's
>> "malloc idiom" and they suggested I write an experience report on it.
>> I wrote the bulk of the article a month ago, but finally put in some
>> finishing touches and published.
>>
>> For whatever it's worth (probably not much):
>> https://9vx.org/post/a-malloc-idiom-in-go/
>>
>> --dho
>
> --
> 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.

-- 
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