This is tutorial number 10 in Golang tutorial series. What is a switch statement? A switch is a conditional statement that evaluates an expression and compares it against a list of possible matches and executes the corresponding block of code. It can be considered as an idiomatic way of replacing complex if else clauses. Example An example program is worth a hundred words. Let’s start with a simple example which will take a finger number as input and outputs the name of that finger :) .