Go Tutorial - Learn Go from the Basics with Code Examples on golangbot.com · Oct 26, 2024
Switch Statement
0Sign in to vote or save
This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.
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…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.