Section6.63
This commit is contained in:
21
Section6/62.go
Normal file
21
Section6/62.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
outer := 19
|
||||
_ = outer
|
||||
people := [5]string{"Helen", "Mark", "Brenda", "Antonio", "Michael"}
|
||||
friends := [2]string{"Mark", "Marry"}
|
||||
|
||||
outer:
|
||||
for index, name := range people {
|
||||
for _, friend := range friends {
|
||||
if name == friend {
|
||||
fmt.Printf("Found a friend %q at index %d\n", friend, index)
|
||||
break outer
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt.Println("Next instruction after the break")
|
||||
}
|
||||
Reference in New Issue
Block a user