Skip to content

Commit

Permalink
chore: add switch statement to test app
Browse files Browse the repository at this point in the history
  • Loading branch information
kilianc committed May 18, 2024
1 parent 5f89990 commit 3254971
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions go-test-app-01/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ func main() {
fmt.Println("Tails")
}

printColor("red")

fmt.Println("Maybe:", maybe())
}

Expand All @@ -32,3 +34,16 @@ func maybe() bool {
return false
}
}

func printColor(color string) {
switch color {
case "red":
fmt.Println("Red")
case "blue":
fmt.Println("Blue")
case "green":
fmt.Println("Green")
default:
fmt.Println("Unknown color")
}
}

0 comments on commit 3254971

Please sign in to comment.