http://play.golang.org/p/vhaKi5uVmm
package main
import \"fmt\"
var battle = make(chan string)
func warrior(name string, done chan struct{}) {
select
Good questions,
The whole point of the struct channel in this scenario is simply to signal the completion that something useful has happened. The channel type doesn't really matter, he could have used an int or a bool to accomplish the same effect. What's important is that his code is executing in a synchronized fashion where he's doing the necessary bookkeeping to signal and move on at key points.
I agree the syntax of struct{}{} looks odd at first because in this example he is declaring a struct and creating it in-line hence the second set of brackets.
If you had a pre-existing object like:
type Book struct{
}
You could create it like so: b := Book{}, you only need one set of brackets because the Book struct has already been declared.