News for hackers. Stuff that matters.
Re:Go Things I Love: Channels and Goroutines by dickeytk on Wednesday January 08, 2020 @11:28AM (#21992836)
off tangent, but I really like that syntax of defining types especially for channels:

    type Foo(chan<- int)
instead of what I usually see

    type Foo chan<- int
unfortunately it doesn't appear compatible with gofmt (entirely), which changes it to:

    type Foo (chan<- int)
I still think it's a good pattern for channels though. It makes it a lot clearer what the type is especially if you have a slice of channels:

    type Foo []chan<- int
vs

    type Foo [](chan<- int)

There are no comments on this comment yet.