Few additional possible solutions:

1. use something similar to https://github.com/awalterschulze/goderive 
create appropriate func.
2. some IDE / tool should be able to figure these refactorings out... or at 
least find the places that need to be changed. Changing a field or method 
name is quite similar to this problem so I cannot see why an editor 
wouldn't be able to do it.

*As for the proposed solution "make(Set.members)", I like it :)*

On Thursday, 22 February 2018 23:58:25 UTC+2, Devon H. O'Dell wrote:
>
> 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  <jake...@gmail.com <javascript:>>: 
> > 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...@googlegroups.com <javascript:>. 
> > 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