From: Rob Pike Date: Wed, 27 Mar 2013 23:30:20 +0000 (-0700) Subject: vet: fix test_deadcode.go's tests X-Git-Tag: go1.1rc2~297 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b06b77b8cfec55529b437c50348448f0d7ae8b15;p=gostls13.git vet: fix test_deadcode.go's tests This is a totally mechanical change. Errors are reported for the beginning of the statement, not the end, so the errchk markers need to be on the opening brace, not the closing one. It seems this test was never run. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7746050 --- diff --git a/src/cmd/vet/test_deadcode.go b/src/cmd/vet/test_deadcode.go index 3ded80ca23..d08e57782f 100644 --- a/src/cmd/vet/test_deadcode.go +++ b/src/cmd/vet/test_deadcode.go @@ -112,31 +112,31 @@ func _() int { func _() int { print(1) return 2 - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } func _() int { L: print(1) goto L - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } func _() int { print(1) panic(2) - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } func _() int { { print(1) return 2 - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } } @@ -145,8 +145,8 @@ L: { print(1) goto L - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } } @@ -154,8 +154,8 @@ func _() int { print(1) { panic(2) - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } } @@ -164,8 +164,8 @@ func _() int { print(1) return 2 } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } func _() int { @@ -174,8 +174,8 @@ L: print(1) goto L } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } func _() int { @@ -183,8 +183,8 @@ func _() int { { panic(2) } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } func _() int { @@ -991,31 +991,31 @@ func _() int { func _() int { return 2 - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } func _() int { L: goto L - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } func _() int { panic(2) - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } func _() int { { return 2 - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } println() // ok } @@ -1024,8 +1024,8 @@ func _() int { L: { goto L - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } println() // ok } @@ -1033,8 +1033,8 @@ L: func _() int { { panic(2) - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } println() // ok } @@ -1043,8 +1043,8 @@ func _() int { { return 2 } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } @@ -1053,8 +1053,8 @@ L: { goto L } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } @@ -1062,8 +1062,8 @@ func _() int { { panic(2) } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } @@ -1165,31 +1165,31 @@ var _ = func() int { var _ = func() int { print(1) return 2 - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } var _ = func() int { L: print(1) goto L - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } var _ = func() int { print(1) panic(2) - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } var _ = func() int { { print(1) return 2 - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } } @@ -1198,8 +1198,8 @@ L: { print(1) goto L - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } } @@ -1207,8 +1207,8 @@ var _ = func() int { print(1) { panic(2) - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } } @@ -1217,8 +1217,8 @@ var _ = func() int { print(1) return 2 } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } var _ = func() int { @@ -1227,8 +1227,8 @@ L: print(1) goto L } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } var _ = func() int { @@ -1236,8 +1236,8 @@ var _ = func() int { { panic(2) } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } var _ = func() int { @@ -2044,31 +2044,31 @@ var _ = func() int { var _ = func() int { return 2 - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } var _ = func() int { L: goto L - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } var _ = func() int { panic(2) - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } var _ = func() int { { return 2 - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } println() // ok } @@ -2077,8 +2077,8 @@ var _ = func() int { L: { goto L - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } println() // ok } @@ -2086,8 +2086,8 @@ L: var _ = func() int { { panic(2) - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } } println() // ok } @@ -2096,8 +2096,8 @@ var _ = func() int { { return 2 } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } @@ -2106,8 +2106,8 @@ L: { goto L } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok } @@ -2115,7 +2115,7 @@ var _ = func() int { { panic(2) } - { - } // ERROR "unreachable code" + { // ERROR "unreachable code" + } println() // ok }