Happy April Fool's Day

April 1, 2024

I’ll be streaming some live coding again, on this April Fool’s day. No joke. I hope you’ll join me.


It’s April Fool’s day. And I also recently learned of #AprilCools – the idea of doing something off-topic, but serious, rather than cringey on April first.

So this year, I, eh… extended my “Learn Go” book review series to review a book about learning Go…. the game, not the language.

Have a watch.


Share this

Direct to your inbox, daily. I respect your privacy .

Unsure? Browse the archive .

Related Content


Switch expressions

Expression switches … If the switch expression evaluates to an untyped constant, it is first implicitly converted to its default type. The predeclared untyped value nil cannot be used as a switch expression. The switch expression type must be comparable. In this paragraph, “switch expression” refers to the expression that optionally comes after the switch keyword, as in: switch len(x) { So first off, if it’s a untyped constant, it’s first converted to its default type.


Expression switches

Expression switches In an expression switch, the switch expression is evaluated and the case expressions, which need not be constants, are evaluated left-to-right and top-to-bottom; the first one that equals the switch expression triggers execution of the statements of the associated case; the other cases are skipped. If no case matches and there is a “default” case, its statements are executed. There can be at most one default case and it may appear anywhere in the “switch” statement.


Switch statements

Yesterday we looked at if statements, which allows conditional execution of two branches. And we saw how by chaining else if we can extend that to an arbitrary number of branches. But there’s often a cleaner way to handle multiple branches: Switch statements “Switch” statements provide multi-way execution. An expression or type is compared to the “cases” inside the “switch” to determine which branch to execute. SwitchStmt = ExprSwitchStmt | TypeSwitchStmt .