Sobes.tech
Junior — Senior

Sending an empty structure over a channel and reading it in a goroutine

livecode

Task condition

It is necessary to find out what output will appear in the console when an empty structure is passed into a channel and then extracted from it in a separate goroutine.

func main() {
    ch := make(chan struct{})
    ch <- struct{}{}

    go func() {
        fmt.Println(<-ch)
    }()
}