I don't understand the meaning of the double {}. This is not made clear in any learning material. Thanks.
variable <-struct {}{}
I don't understand the meaning of the double {}. This is not made clear in any learning material. Thanks.
variable <-struct {}{}
variable
is a variable of type channel (values are sent on it)
<-
is a send operator
struct{}
is type empty struct (has no fields)
{}
makes it a struct literal (creates a value of the given struct type)
To better understand this form let me give you an example of a different struct type:
p := struct{ X, Y float64 }{0.0, 0.0}