Skip to Main Content
Hands-On GUI Application Development in Go
book

Hands-On GUI Application Development in Go

by Andrew Williams
February 2019
Intermediate to advanced content levelIntermediate to advanced
450 pages
11h 59m
English
Packt Publishing
Content preview from Hands-On GUI Application Development in Go

Channels

The philosophy for sharing data with Go is Don't communicate by sharing memory; instead, share memory by communicating. Channels are the language construct that support this approach  they allow the sharing of data by communicating between goroutines correctly, rather than sharing common data. This is the main way that Go avoids race conditions (that is, one thread writing data while others read the same data). Channels are used for all sorts of patterns in Go  they can communicate the result of a goroutine (or pass data between routines), provide updates when data changes, or even signal that processes should finish.

Channels, just like all variables and constants in Go, require a type. The type of a channel determines the data ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Cross-Platform GUI Applications with Fyne

Building Cross-Platform GUI Applications with Fyne

Andrew Williams

Publisher Resources

ISBN: 9781789138412Supplemental Content