Go channels, in combination with goroutines, are first-class citizens for asynchronous communication. Channels become especially powerful when using select statements. These statements allow a goroutine to intelligently handle requests from multiple channels at once.
Using channels and the select statement
Getting ready
Configure your environment according to these steps:
- Download and install Go on your operating system from https://golang.org/doc/install and configure your GOPATH environment variable.
- Open a terminal/console application.
- Navigate to GOPATH/src and create a project directory, such as $GOPATH/src/github.com/yourusername/customrepo.
All code will be run and modified from this directory.
- Optionally, install...