From: Rob Pike Date: Mon, 16 Sep 2013 21:41:11 +0000 (+1000) Subject: spec: add example for continue to label X-Git-Tag: go1.2rc2~192 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=cec0954dd04b585b1cadacbb5f46ae5ab76a371c;p=gostls13.git spec: add example for continue to label Make the break example slightly more interesting Update #5725 Effective Go will be updated in a separate CL. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13368054 --- diff --git a/doc/go_spec.html b/doc/go_spec.html index b9249e1c78..7b74e8ffb5 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -3345,7 +3345,7 @@ As an exception to the addressability requirement, x may also be a (possibly parenthesized) composite literal. If the evaluation of x would cause a run-time panic, -then the evaluation of &x does too. +then the evaluation of &x does too.

@@ -3365,7 +3365,7 @@ will cause a run-time panic. var x *int = nil *x // causes a run-time panic -&*x // causes a run-time panic +&*x // causes a run-time panic @@ -4997,11 +4997,17 @@ and that is the one whose execution terminates.

-L:
-	for i < n {
-		switch i {
-		case 5:
-			break L
+OuterLoop:
+	for i = 0; i < n; i++ {
+		for j = 0; j < m; j++ {
+			switch a[i][j] {
+			case nil:
+				state = Error
+				break OuterLoop
+			case item:
+				state = Found
+				break OuterLoop
+			}
 		}
 	}
 
@@ -5023,6 +5029,18 @@ If there is a label, it must be that of an enclosing advances.

+
+RowLoop:
+	for y, row := range rows {
+		for x, data := range row {
+			if data == endOfRow {
+				continue RowLoop
+			}
+			row[x] = data + bias(x, y)
+		}
+	}
+
+

Goto statements