Created
June 9, 2016 19:56
-
-
Save eduncan911/a422423f5a42f1825f5ededf9610f1cd to your computer and use it in GitHub Desktop.
Revisions
-
eduncan911 created this gist
Jun 9, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ package main import "fmt" /* Here's a use of labels in Go to continue a for loop from within another for and within a switch case. */ func main() { foo := []string{"a", "b", "c", "d", "e", "f", "g"} bar := []string{"b", "d", "f"} fooloop: for _, v := range foo { for _, v2 := range bar { switch { case v == v2: continue fooloop } } fmt.Println(v) } } /* output$ go run main.go a c e g */