mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-26 11:26:56 +08:00
refactor: better for testing purpose
This commit is contained in:
parent
37ee9bbd5a
commit
4b90adf855
1 changed files with 2 additions and 4 deletions
|
|
@ -7,10 +7,9 @@ import (
|
|||
|
||||
func listing1() {
|
||||
for i := 0; i < 5; i++ {
|
||||
fmt.Printf("%d ", i)
|
||||
|
||||
switch i {
|
||||
default:
|
||||
fmt.Printf("%d ", i)
|
||||
case 2:
|
||||
break
|
||||
}
|
||||
|
|
@ -20,10 +19,9 @@ func listing1() {
|
|||
func listing2() {
|
||||
loop:
|
||||
for i := 0; i < 5; i++ {
|
||||
fmt.Printf("%d ", i)
|
||||
|
||||
switch i {
|
||||
default:
|
||||
fmt.Printf("%d ", i)
|
||||
case 2:
|
||||
break loop
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue