August 2016
Beginner to intermediate
665 pages
14h 11m
English
You may have noticed the anonymous goroutine in Lorem Ipsum:
go func() {
go capitalize(index, length, letters, &finalIpsum)
}()While it isn't always ideal, there are plenty of places where inline functions work best in creating a goroutine.
The easiest way to describe this is to say that a function isn't big or important enough to deserve a named function, but the truth is, it's more about readability. If you have dealt with lambdas in other languages, this probably doesn't need much explanation, but try to reserve these for quick inline functions.
In the earlier examples, the closure works largely as a wrapper to invoke a select statement or to create anonymous goroutines that will feed the select statement.
Since functions ...
Read now
Unlock full access