Deferring functions for "on entry" actions

I decided to learn Go because it seems an interesting and easy to learn low-level programming language. There are several free online resources to learn the language, such as The Go Tour, but I decided to Go for the book "The Go Programming Language" (GOPL) by Alan Donovan and Brian Kernighan. In the book, there are some code examples that I find particularly elegant. Here, I want to record some of these examples for future reference -- while having the chance to add some additional comments on the code for myself.1

An ode to the pipe operator

What I particularly like about the tidyverse is the pipe operator %>%. For me it is more than a convenient way of concatenating tasks, prettifying and/or reducing the amount of code. I intrinsically connect it to the first two principles of the UNIX philosophy:1