Commit 26a85211 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder Committed by Brad Fitzpatrick

test: gofmt chan/*.go

These are functional tests, so it is safe to gofmt them.

Change-Id: I3067279c1d49809ac6a62054448ab8a6c3de9bda
Reviewed-on: https://go-review.googlesource.com/43623Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent a9bf3b2e
...@@ -54,4 +54,3 @@ func main() { ...@@ -54,4 +54,3 @@ func main() {
AsynchFifo() AsynchFifo()
SynchFifo() SynchFifo()
} }
...@@ -57,10 +57,10 @@ func main() { ...@@ -57,10 +57,10 @@ func main() {
_ = x _ = x
} }
for _ = range cs {// ERROR "receive" for _ = range cs { // ERROR "receive"
} }
for range cs {// ERROR "receive" for range cs { // ERROR "receive"
} }
close(c) close(c)
......
This diff is collapsed.
This diff is collapsed.
...@@ -14,12 +14,10 @@ import "time" ...@@ -14,12 +14,10 @@ import "time"
const always = "function did not" const always = "function did not"
const never = "function did" const never = "function did"
func unreachable() { func unreachable() {
panic("control flow shouldn't reach here") panic("control flow shouldn't reach here")
} }
// Calls f and verifies that f always/never panics depending on signal. // Calls f and verifies that f always/never panics depending on signal.
func testPanic(signal string, f func()) { func testPanic(signal string, f func()) {
defer func() { defer func() {
...@@ -34,7 +32,6 @@ func testPanic(signal string, f func()) { ...@@ -34,7 +32,6 @@ func testPanic(signal string, f func()) {
f() f()
} }
// Calls f and empirically verifies that f always/never blocks depending on signal. // Calls f and empirically verifies that f always/never blocks depending on signal.
func testBlock(signal string, f func()) { func testBlock(signal string, f func()) {
c := make(chan string) c := make(chan string)
...@@ -51,7 +48,6 @@ func testBlock(signal string, f func()) { ...@@ -51,7 +48,6 @@ func testBlock(signal string, f func()) {
} }
} }
func main() { func main() {
const async = 1 // asynchronous channels const async = 1 // asynchronous channels
var nilch chan int var nilch chan int
...@@ -114,8 +110,7 @@ func main() { ...@@ -114,8 +110,7 @@ func main() {
// empty selects always block // empty selects always block
testBlock(always, func() { testBlock(always, func() {
select { select {}
}
}) })
// selects with only nil channels always block // selects with only nil channels always block
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment