Section6.63

This commit is contained in:
2023-10-07 08:55:56 +02:00
parent dda560aaa8
commit ffb74ec6b0
2 changed files with 35 additions and 0 deletions

21
Section6/62.go Normal file
View 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")
}