Friday, April 06, 2018

book: The Go Programming Language

The Go Programming Language
Alan A. A. Donovan · Brian W. Kernighan

"When you’re learning a new language, there’s a natural tendency to write code as you would have written it in a language you already know. Be aware of this bias as you learn Go and try to avoid it."

"Do not communicate by sharing memory;
instead, share memory by communicating."

adonovan/ Example programs from "The Go Programming Language" @ GitHub

The Go Programming Language (Addison-Wesley Professional Computing Series): 9780134190440: Computer Science Books @

Many people learned C lang from this book: C Programming Language, 2nd Edition (8601410794231): Brian W. Kernighan, Dennis M. Ritchie: Books

When co-creator of C  Ken Thompson co-created new Go programming language,
Brian W. Kernighan, co-author of original C book, co-authored new excellent Go book.

With book on new computer language, Kernighan guides students at Princeton and beyond

Notes and examples from the book:

notes/ at master · shichao-an/notes @ GitHub

Contents - Shichao's Notes

Chapter 9. Concurrency with Shared Variables - Shichao's Notes

Thread-safety without explicit locks:

// Package bank provides a concurrency-safe bank with one account.
package bank

var deposits = make(chan int) // send amount to deposit
var balances = make(chan int) // receive balance

func Deposit(amount int) { deposits <- amount }
func Balance() int       { return <-balances }

func teller() {
    var balance int // balance is confined to teller goroutine
    for {
        select {
        case amount := <-deposits:
            balance += amount
        case balances <- balance:

func init() {
    go teller() // start the monitor goroutine

Deploying Docker containers to Azure

Kubernetes has "won" so quickly to become a default containers orchestrator that documentation of cloud services sometimes didn't catch up with software updates. 
On Azure, it used to be Azure Container Service
  • used to be "ACS": meaning that you one can deploy Linux VM instance with choice of containers orchestration tool: DC/OS, Docker Swarm or Kubernetes. 
  • now it is "AKS": As a hosted Kubernetes service.
Introduction to Azure Container Service for Kubernetes | Microsoft Docs
Microsoft Azure
"Azure Container Service, currently known as ACS, which has grown 300% in the last six months. Now with the preview of AKS, we are making it even easier to manage and operate your Kubernetes environments, all without sacrificing portability. This new service features an Azure-hosted control plane, automated upgrades, self-healing, easy scaling, and a simple user experience for both developers and cluster operators. With AKS, customers get the benefit of open source Kubernetes without complexity and operational overhead."