mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
test: gofmt a few tests
I'm planning to change these tests, but the gofmt changes are fairly extensive, so I'm separating the gofmt changes from the substantive changes. R=golang-dev, rsc, r CC=golang-dev https://golang.org/cl/5557052
This commit is contained in:
parent
20812c4907
commit
6b3462820f
8 changed files with 242 additions and 248 deletions
|
|
@ -7,19 +7,23 @@
|
|||
package main
|
||||
|
||||
func main() {
|
||||
var i, k int;
|
||||
outer:
|
||||
for k=0; k<2; k++ {
|
||||
print("outer loop top k ", k, "\n");
|
||||
if k != 0 { panic("k not zero") } // inner loop breaks this one every time
|
||||
for i=0; i<2; i++ {
|
||||
if i != 0 { panic("i not zero") } // loop breaks every time
|
||||
print("inner loop top i ", i, "\n");
|
||||
var i, k int
|
||||
outer:
|
||||
for k = 0; k < 2; k++ {
|
||||
print("outer loop top k ", k, "\n")
|
||||
if k != 0 {
|
||||
panic("k not zero")
|
||||
} // inner loop breaks this one every time
|
||||
for i = 0; i < 2; i++ {
|
||||
if i != 0 {
|
||||
panic("i not zero")
|
||||
} // loop breaks every time
|
||||
print("inner loop top i ", i, "\n")
|
||||
if true {
|
||||
print("do break\n");
|
||||
break outer;
|
||||
print("do break\n")
|
||||
break outer
|
||||
}
|
||||
}
|
||||
}
|
||||
print("broke\n");
|
||||
print("broke\n")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue