diff options
author | Rob Pike <r@golang.org> | 2009-08-17 13:30:22 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2009-08-17 13:30:22 -0700 |
commit | dc7bf11e534b92ce21630d07d0dc88096d7fb6f7 (patch) | |
tree | 971cc7e3c955465162133ad90062126ba518107a /test/chan | |
parent | b614df3e168a31ebef8b814fc250ecfe63409d29 (diff) | |
download | go-dc7bf11e534b92ce21630d07d0dc88096d7fb6f7.tar.gz |
fix up some irregular indentation
R=rsc
OCL=33382
CL=33391
Diffstat (limited to 'test/chan')
-rw-r--r-- | test/chan/select.go | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/test/chan/select.go b/test/chan/select.go index d8a462551..4c4ffa549 100644 --- a/test/chan/select.go +++ b/test/chan/select.go @@ -10,42 +10,43 @@ var counter uint var shift uint func GetValue() uint { - counter++; - return 1 << shift + counter++; + return 1 << shift } func Send(a, b chan uint) int { - var i int; - LOOP: - for { - select { - case a <- GetValue(): - i++; - a = nil; - case b <- GetValue(): - i++; - b = nil; - default: - break LOOP; - } - shift++; - } - return i; + var i int; + +LOOP: + for { + select { + case a <- GetValue(): + i++; + a = nil; + case b <- GetValue(): + i++; + b = nil; + default: + break LOOP; + } + shift++; + } + return i; } func main() { - a := make(chan uint, 1); - b := make(chan uint, 1); - if v := Send(a, b); v != 2 { - panicln("Send returned", v, "!= 2"); - } - if av, bv := <- a, <- b; av | bv != 3 { - panicln("bad values", av, bv); - } - if v := Send(a, nil); v != 1 { - panicln("Send returned", v, "!= 1"); - } - if counter != 10 { - panicln("counter is", counter, "!= 10"); - } + a := make(chan uint, 1); + b := make(chan uint, 1); + if v := Send(a, b); v != 2 { + panicln("Send returned", v, "!= 2"); + } + if av, bv := <- a, <- b; av | bv != 3 { + panicln("bad values", av, bv); + } + if v := Send(a, nil); v != 1 { + panicln("Send returned", v, "!= 1"); + } + if counter != 10 { + panicln("counter is", counter, "!= 10"); + } } |