August 2019
Beginner to intermediate
798 pages
17h 2m
English
A channel of channels is a special kind of channel variable that works with channels instead of other types of variables. Nevertheless, you still have to declare a data type for a channel of channels. You can define a channel of channels using the chan keyword twice in a row, as shown in the following statement:
c1 := make(chan chan int)
The use of channels of channels is illustrated using the code found in chSquare.go, which will be presented in four parts.
The first part of chSquare.go is as follows:
package main
import (
"fmt"
"os"
"strconv"
"time"
)
var times int
The second code portion from chSquare.go ...
Read now
Unlock full access