Skip to content

Commit ecf7f8c

Browse files
committed
Fix userName variable redeclaration in Switches.md
Updated the userName variable assignments to use the same variable instead of redeclaring it.
1 parent f5c418d commit ecf7f8c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tutorials/learn-golang.org/en/Switches.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Let's write an example code to check if the user's name is `John` or not
7575
}
7676

7777
// let's change the username variable
78-
userName := "Bob"
78+
userName = "Bob"
7979

8080
// prints Hi Bob!
8181
switch userName {
@@ -86,10 +86,9 @@ Let's write an example code to check if the user's name is `John` or not
8686
default:
8787
fmt.Println("I don't know you!")
8888
}
89-
userName := "Bob"
9089

9190
// let's change the username variable again
92-
userName := "Matthew"
91+
userName = "Matthew"
9392

9493
// prints I don't know you!
9594
switch userName {

0 commit comments

Comments
 (0)