]> Cypherpunks.ru repositories - gostls13.git/commitdiff
fix up some irregular indentation
authorRob Pike <r@golang.org>
Mon, 17 Aug 2009 20:30:22 +0000 (13:30 -0700)
committerRob Pike <r@golang.org>
Mon, 17 Aug 2009 20:30:22 +0000 (13:30 -0700)
R=rsc
OCL=33382
CL=33391

39 files changed:
test/bugs/bug132.go
test/bugs/bug187.go
test/chan/select.go
test/char_lit.go
test/fixedbugs/bug024.go
test/fixedbugs/bug030.go
test/fixedbugs/bug039.go
test/fixedbugs/bug051.go
test/fixedbugs/bug052.go
test/fixedbugs/bug053.go
test/fixedbugs/bug057.go
test/fixedbugs/bug058.go
test/fixedbugs/bug062.go
test/fixedbugs/bug097.go
test/fixedbugs/bug106.dir/bug0.go
test/fixedbugs/bug106.dir/bug1.go
test/fixedbugs/bug107.go
test/fixedbugs/bug109.go
test/fixedbugs/bug113.go
test/fixedbugs/bug117.go
test/fixedbugs/bug118.go
test/fixedbugs/bug123.go
test/fixedbugs/bug127.go
test/fixedbugs/bug130.go
test/fixedbugs/bug131.go
test/fixedbugs/bug135.go
test/golden.out
test/int_lit.go
test/interface/struct.go
test/ken/chan1.go
test/ken/divconst.go
test/ken/modconst.go
test/method1.go
test/run
test/sieve.go
test/string_lit.go
test/stringrange.go
test/test0.go
test/varinit.go

index 58ebfcb4487fc2370daa04a40bab162723d7d463..58bbe077eca94acbdf94a5f57e82253aa4ed5541 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// ! $G $D/$F.go || echo BUG: compilation succeeds incorrectly
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index dafe6eaca71a8203fa6a874d2bdfaa22f04e2026..73d73dbb87ca2ed8d23d2f83e3169e0d60efbb53 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright 2009 The Go Authors.  All rights reserved.
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// $G $D/$F.go && $L $F.$A && ./$A.out
-
 package main
 
 import "os"
index d8a462551acd117a50adc42379bd4f591dce0a6e..4c4ffa549aee1ce0023dbaf8ee64cecc559fd4e7 100644 (file)
@@ -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");
+       }
 }
index 6699442dc8ad6bedef05fd5576b9477ba3be01e6..689a54a2faeb49a946e19a22430ac35c03dfa954 100644 (file)
@@ -9,36 +9,36 @@ package main
 import "os"
 
 func main() {
-  var i uint64 =
-    ' ' +
-    'a' +
-    'ä' +
-    '本' +
-    '\a' +
-    '\b' +
-    '\f' +
-    '\n' +
-    '\r' +
-    '\t' +
-    '\v' +
-    '\\' +
-    '\'' +
-    '\000' +
-    '\123' +
-    '\x00' +
-    '\xca' +
-    '\xFE' +
-    '\u0123' +
-    '\ubabe' +
-    '\U0123ABCD' +
-    '\Ucafebabe'
-  ;
-  if '\Ucafebabe' != 0xcafebabe {
-       print("cafebabe wrong\n");
-       os.Exit(1)
-  }
-  if i != 0xcc238de1 {
-       print("number is ", i, " should be ", 0xcc238de1, "\n");
-       os.Exit(1)
-  }
+       var i uint64 =
+               ' ' +
+               'a' +
+               'ä' +
+               '本' +
+               '\a' +
+               '\b' +
+               '\f' +
+               '\n' +
+               '\r' +
+               '\t' +
+               '\v' +
+               '\\' +
+               '\'' +
+               '\000' +
+               '\123' +
+               '\x00' +
+               '\xca' +
+               '\xFE' +
+               '\u0123' +
+               '\ubabe' +
+               '\U0123ABCD' +
+               '\Ucafebabe'
+               ;
+       if '\Ucafebabe' != 0xcafebabe {
+               print("cafebabe wrong\n");
+               os.Exit(1)
+       }
+       if i != 0xcc238de1 {
+               print("number is ", i, " should be ", 0xcc238de1, "\n");
+               os.Exit(1)
+               }
 }
index 51bf5296ffbb4caf320fce5272dce312e76e7bb3..0f4b2ca178de688e4bc6970298b7c6327a25d7af 100644 (file)
@@ -7,11 +7,11 @@
 package main
 
 func main() {
-  var i int;
-  i = '\'';
-  i = '\\';
-  var s string;
-  s = "\"";
+       var i int;
+       i = '\'';
+       i = '\\';
+       var s string;
+       s = "\"";
 }
 /*
 bug.go:5: unknown escape sequence: '
index 4ee65d00333f228ac94b67b4ca6a547391233040..e1fce0180dc7e07374b9f4ab9421f764c421bbf6 100644 (file)
@@ -7,6 +7,6 @@
 package main
 
 func main() {
-  var x int;
-  x := 0; // ERROR "declar|:="
+       var x int;
+       x := 0; // ERROR "declar|:="
 }
index 591b7fe7db7e9c6b48d4710f26875ad641a428ca..30fbdbd3fab0b9a3e044322863f0ec62dc86e7d3 100644 (file)
@@ -7,5 +7,5 @@
 package main
 
 func main (x int) {    // GCCGO_ERROR "previous"
-  var x int;  // ERROR "redecl|redefinition"
+       var x int;      // ERROR "redecl|redefinition"
 }
index 199a4b95c1233fa25103053ba1777fdd5d5dad4a..dd1662306dcd21bd1137130ddfb6c6a373effdbe 100644 (file)
@@ -7,9 +7,9 @@
 package main
 
 func f() int {
-  return 0;
+       return 0;
 }
 
 func main() {
-  const n = f();  // ERROR "const"
+       const n = f();  // ERROR "const"
 }
index 07c651d4ac3cc2dfff958bbea21fc6c93633267a..d2c1b50617aa00fb01797f373a54c9af27e8b2d0 100644 (file)
@@ -7,14 +7,14 @@
 package main
 
 func main() {
-  c := 10;
-  d := 7;
-  var x [10]int;
-  i := 0;
-  /* this works:
-  q := c/d;
-  x[i] = q;
-  */
-  // this doesn't:
-  x[i] = c/d;  // BUG segmentation fault
+       c := 10;
+       d := 7;
+       var x [10]int;
+       i := 0;
+       /* this works:
+       q := c/d;
+       x[i] = q;
+       */
+       // this doesn't:
+       x[i] = c/d;     // BUG segmentation fault
 }
index fe6ca4999997b700fbc580da1b498e9e63fb22e4..602b0a130f41f91da6c3419cd97e2193778866ab 100644 (file)
@@ -7,5 +7,5 @@
 package main
 
 func main() {
-  var len int;  // len should not be a keyword - this doesn't compile
+       var len int;    // len should not be a keyword - this doesn't compile
 }
index 1c959b8c83dd2a0c7fe9b488bbed57237d357792..3847dffb8583b6228c88a85041126a86f803319e 100644 (file)
@@ -7,15 +7,15 @@
 package main
 
 type T struct {
-  s string;
+       s string;
 }
 
 
 func main() {
-  s := "";
-  l1 := len(s);
-  var t T;
-  l2 := len(t.s);  // BUG: cannot take len() of a string field
+       s := "";
+       l1 := len(s);
+       var t T;
+       l2 := len(t.s); // BUG: cannot take len() of a string field
 }
 
 /*
index da47ae568701090dd7ed16d10b63fedcbd89a02e..e2b4a241a6326123ebd3e66792a0e8a7e9033356 100644 (file)
@@ -10,10 +10,10 @@ type Box struct {};
 var m map[string] *Box;
 
 func main() {
-  m := make(map[string] *Box);
-  s := "foo";
-  var x *Box = nil;
-  m[s] = x;
+       m := make(map[string] *Box);
+       s := "foo";
+       var x *Box = nil;
+       m[s] = x;
 }
 
 /*
index c869eb22242e439068791023abc769d2ad348869..8ee5c84cb9d046bca187d34fe1b9ba617d2c42b1 100644 (file)
@@ -7,5 +7,5 @@
 package main
 
 func main() {
-  var s string = nil;  // ERROR "illegal|invalid|incompatible|cannot"
+       var s string = nil;     // ERROR "illegal|invalid|incompatible|cannot"
 }
index 70bd6e2b47e0c51913a34dbebdddb1831f59ed35..d5e40999cef71808304dde518197b67839b2bb82 100644 (file)
@@ -41,7 +41,7 @@ pc: 0x4558
 */
 
 /* An array composite literal needs to be created freshly every time.
-   It is a "construction" of an array after all. If I pass the address
-   of the array to some function, it may store it globally. Same applies
-   to struct literals.
+        It is a "construction" of an array after all. If I pass the address
+        of the array to some function, it may store it globally. Same applies
+        to struct literals.
 */
index 7daf209448ca58d7be92b827697c3969defefda6..d9c26a00bd1c93c684d0eef8594fc11d9cd16171 100644 (file)
@@ -3,4 +3,5 @@
 // license that can be found in the LICENSE file.
 
 package bug0
+
 const A = -1
index 6ef40e94a224baff814d703939d091c5c265e4f1..87f4fbb9db92335fa2e2439456e56d363bcf70e7 100644 (file)
@@ -3,5 +3,6 @@
 // license that can be found in the LICENSE file.
 
 package bug1
+
 import "./bug0"
 
index 80fa9664791e2854163f7611c6a2e469684fd368..87cdca7fc3d84fe23262f746b26c6ac88bc4b7a4 100644 (file)
@@ -7,8 +7,8 @@
 package main
 import os "os"
 func f() (os int) {
-     // In the next line "os" should refer to the result variable, not
-     // to the package.
-     v := os.Open("", 0, 0);   // ERROR "undefined"
-     return 0
+        // In the next line "os" should refer to the result variable, not
+        // to the package.
+        v := os.Open("", 0, 0);        // ERROR "undefined"
+        return 0
 }
index 61ede1b513be18e1f37637af1f216bf9ff45de38..c679771f2ec107e6797e16410d6b230893290188 100644 (file)
@@ -14,11 +14,11 @@ func f(a float) float {
 /*
 6g bugs/bug109.go
 bugs/bug109.go:5: illegal types for operand: MUL
-        (<float64>FLOAT64)
-        (<float32>FLOAT32)
+       (<float64>FLOAT64)
+       (<float32>FLOAT32)
 bugs/bug109.go:5: illegal types for operand: AS
-        (<float64>FLOAT64)
+       (<float64>FLOAT64)
 bugs/bug109.go:6: illegal types for operand: RETURN
-        (<float32>FLOAT32)
-        (<float64>FLOAT64)
+       (<float32>FLOAT32)
+       (<float64>FLOAT64)
 */
index 14bd07692637e360f4587c8666bbe6c5bc485fb3..4b9b1397a8bc656ca2831f6e5ed2bacf7b53b4a8 100644 (file)
@@ -9,12 +9,12 @@ type I interface { };
 func foo1(i int) int { return i }
 func foo2(i int32) int32 { return i }
 func main() {
-  var i I;
-  i = 1;
-  var v1 = i.(int);
-  if foo1(v1) != 1 { panicln(1) }
-  var v2 = int32(i.(int));
-  if foo2(v2) != 1 { panicln(2) }
-  var v3 = i.(int32); // This type conversion should fail at runtime.
-  if foo2(v3) != 1 { panicln(3) }
+       var i I;
+       i = 1;
+       var v1 = i.(int);
+       if foo1(v1) != 1 { panicln(1) }
+       var v2 = int32(i.(int));
+       if foo2(v2) != 1 { panicln(2) }
+       var v3 = i.(int32); // This type conversion should fail at runtime.
+       if foo2(v3) != 1 { panicln(3) }
 }
index 8e447cd455a784614034151fc9fec75aed25c3ce..2cb6d6c31b581ed89dd40745ce10acaa8e7acb4c 100644 (file)
@@ -8,18 +8,18 @@ package main
 type S struct { a int }
 type PS *S
 func (p *S) get() int {
-  return p.a
+       return p.a
 }
 
 func fn(p PS) int {
-  // p has type PS, and PS has no methods.
-  // (a compiler might see that p is a pointer
-  // and go looking in S without noticing PS.)
-  return p.get()       // ERROR "undefined"
+       // p has type PS, and PS has no methods.
+       // (a compiler might see that p is a pointer
+       // and go looking in S without noticing PS.)
+       return p.get()  // ERROR "undefined"
 }
 func main() {
-  s := S{1};
-  if s.get() != 1 {
-    panic()
-  }
+       s := S{1};
+       if s.get() != 1 {
+               panic()
+       }
 }
index 94f5ffd353148d53cb121f5c0bfa1f2127695d05..1271f5b0cb2b6d3074cfcca0e05206918ad02cf1 100644 (file)
@@ -7,9 +7,9 @@
 package main
 
 func Send(c chan int) int {
-  select {
-  default:
-    return 1;
-  }
-  return 2;
+       select {
+       default:
+               return 1;
+       }
+       return 2;
 }
index f26a0463695b5f849dedaa4460d8b9680dfdb6e6..bdac67417f1ee519e6aa1178f786e867b500db76 100644 (file)
@@ -7,8 +7,8 @@
 package main
 const ( F = 1 )
 func fn(i int) int {
-  if i == F() {                // ERROR "func"
-    return 0
-  }
-  return 1
+       if i == F() {           // ERROR "func"
+               return 0
+       }
+       return 1
 }
index ca7b134de22cd72b100f62c9fd18f3b4040cad57..25b48114d6ff0a189f1212747717b03a257ed797 100644 (file)
@@ -6,7 +6,7 @@
 
 package main
 func main() {
-        var x int64 = 0;
-        println(x != nil);     // ERROR "illegal|incompatible|nil"
-        println(0 != nil);     // ERROR "illegal|incompatible|nil"
+       var x int64 = 0;
+       println(x != nil);      // ERROR "illegal|incompatible|nil"
+       println(0 != nil);      // ERROR "illegal|incompatible|nil"
 }
index 3d13cb8ab1c2c6402f60b4e36f71cfd4e4b57407..855c7072bc52f89709e39daf42b71650c93b1e38 100644 (file)
@@ -14,9 +14,9 @@ type S struct { v int }
 func (p *S) send(c chan <- int) { c <- p.v }
 
 func main() {
-  s := S{0};
-  var i I = &s;
-  c := make(chan int);
-  go i.send(c);
-  os.Exit(<-c);
+       s := S{0};
+       var i I = &s;
+       c := make(chan int);
+       go i.send(c);
+       os.Exit(<-c);
 }
index 8205aa56f3dcb3e2a4338bc7619946726d834207..e5d4ca07d774b8afb3ef9329d5bd0bc903fac8bf 100644 (file)
@@ -7,6 +7,6 @@
 package main
 
 func main() {
-  const a uint64 = 10;
-  var b int64 = a;     // ERROR "convert|cannot|incompatible"
+       const a uint64 = 10;
+       var b int64 = a;        // ERROR "convert|cannot|incompatible"
 }
index d7115c4f27d14f3e80bb0df8c075f98c8c33611a..252aa87e663a1a33722c80e699fe03003c9dc338 100644 (file)
@@ -12,7 +12,7 @@ type T struct {}
 func (t *T) foo() {}
 
 func main() {
-  t := new(T);
-  var i interface {};
-  f, ok := i.(Foo);
+       t := new(T);
+       var i interface {};
+       f, ok := i.(Foo);
 }
index 4ced667c854de9bcbb6dc1039231e54dfa39c1df..81b1bc8c6e179b9786b347a37d4b71363fdb3516 100644 (file)
@@ -96,7 +96,7 @@ panic PC=xxx
 == fixedbugs/
 
 =========== fixedbugs/bug016.go
-fixedbugs/bug016.go:7: constant -3 overflows uint
+fixedbugs/bug016.go:11: constant -3 overflows uint
 
 =========== fixedbugs/bug027.go
 hi
@@ -121,7 +121,7 @@ do break
 broke
 
 =========== fixedbugs/bug081.go
-fixedbugs/bug081.go:5: fatal error: typecheck loop
+fixedbugs/bug081.go:9: fatal error: typecheck loop
 
 =========== fixedbugs/bug093.go
 M
index 1f4d318afed0b1fbae63ae32afad211f2a6dbb9c..1cb42f5d11a8c140756e36245b56cba2476a91a2 100644 (file)
@@ -9,17 +9,16 @@ package main
 import "os"
 
 func main() {
-  s :=
-    0 +
-    123 +
-    0123 +
-    0000 +
-    0x0 +
-    0x123 +
-    0X0 +
-    0X123;
-  if s != 788 {
-    print("s is ", s, "; should be 788\n");
-    os.Exit(1);
-  }
+       s :=    0 +
+               123 +
+               0123 +
+               0000 +
+               0x0 +
+               0x123 +
+               0X0 +
+               0X123;
+       if s != 788 {
+               print("s is ", s, "; should be 788\n");
+               os.Exit(1);
+       }
 }
index 49926f0a2fe9e9970ceaf31e86e495f02f404544..32f95b9326d2959ace16b77133e59cc04dd6904f 100644 (file)
@@ -13,10 +13,10 @@ import "os"
 var fail int
 
 func check(b bool, msg string) {
-  if (!b) {
-    println("failure in", msg);
-    fail++;
-  }
+       if (!b) {
+               println("failure in", msg);
+               fail++;
+       }
 }
 
 type I1 interface { Get() int; Put(int); }
@@ -26,27 +26,27 @@ func (p S1) Get() int { return p.i }
 func (p S1) Put(i int) { p.i = i }
 
 func f1() {
-  s := S1{1};
-  var i I1 = s;
-  i.Put(2);
-  check(i.Get() == 1, "f1 i");
-  check(s.i == 1, "f1 s");
+       s := S1{1};
+       var i I1 = s;
+       i.Put(2);
+       check(i.Get() == 1, "f1 i");
+       check(s.i == 1, "f1 s");
 }
 
 func f2() {
-  s := S1{1};
-  var i I1 = &s;
-  i.Put(2);
-  check(i.Get() == 1, "f2 i");
-  check(s.i == 1, "f2 s");
+       s := S1{1};
+       var i I1 = &s;
+       i.Put(2);
+       check(i.Get() == 1, "f2 i");
+       check(s.i == 1, "f2 s");
 }
 
 func f3() {
-  s := &S1{1};
-  var i I1 = s;
-  i.Put(2);
-  check(i.Get() == 1, "f3 i");
-  check(s.i == 1, "f3 s");
+       s := &S1{1};
+       var i I1 = s;
+       i.Put(2);
+       check(i.Get() == 1, "f3 i");
+       check(s.i == 1, "f3 s");
 }
 
 type S2 struct { i int }
@@ -54,27 +54,27 @@ func (p *S2) Get() int { return p.i }
 func (p *S2) Put(i int) { p.i = i }
 
 // func f4() {
-//   s := S2{1};
-//   var i I1 = s;
-//   i.Put(2);
-//   check(i.Get() == 2, "f4 i");
-//   check(s.i == 1, "f4 s");
+//      s := S2{1};
+//      var i I1 = s;
+//      i.Put(2);
+//      check(i.Get() == 2, "f4 i");
+//      check(s.i == 1, "f4 s");
 // }
 
 func f5() {
-  s := S2{1};
-  var i I1 = &s;
-  i.Put(2);
-  check(i.Get() == 2, "f5 i");
-  check(s.i == 2, "f5 s");
+       s := S2{1};
+       var i I1 = &s;
+       i.Put(2);
+       check(i.Get() == 2, "f5 i");
+       check(s.i == 2, "f5 s");
 }
 
 func f6() {
-  s := &S2{1};
-  var i I1 = s;
-  i.Put(2);
-  check(i.Get() == 2, "f6 i");
-  check(s.i == 2, "f6 s");
+       s := &S2{1};
+       var i I1 = s;
+       i.Put(2);
+       check(i.Get() == 2, "f6 i");
+       check(s.i == 2, "f6 s");
 }
 
 type I2 interface { Get() int64; Put(int64); }
@@ -84,27 +84,27 @@ func (p S3) Get() int64 { return p.l }
 func (p S3) Put(i int64) { p.l = i }
 
 func f7() {
-  s := S3{1, 2, 3, 4};
-  var i I2 = s;
-  i.Put(5);
-  check(i.Get() == 4, "f7 i");
-  check(s.l == 4, "f7 s");
+       s := S3{1, 2, 3, 4};
+       var i I2 = s;
+       i.Put(5);
+       check(i.Get() == 4, "f7 i");
+       check(s.l == 4, "f7 s");
 }
 
 func f8() {
-  s := S3{1, 2, 3, 4};
-  var i I2 = &s;
-  i.Put(5);
-  check(i.Get() == 4, "f8 i");
-  check(s.l == 4, "f8 s");
+       s := S3{1, 2, 3, 4};
+       var i I2 = &s;
+       i.Put(5);
+       check(i.Get() == 4, "f8 i");
+       check(s.l == 4, "f8 s");
 }
 
 func f9() {
-  s := &S3{1, 2, 3, 4};
-  var i I2 = s;
-  i.Put(5);
-  check(i.Get() == 4, "f9 i");
-  check(s.l == 4, "f9 s");
+       s := &S3{1, 2, 3, 4};
+       var i I2 = s;
+       i.Put(5);
+       check(i.Get() == 4, "f9 i");
+       check(s.l == 4, "f9 s");
 }
 
 type S4 struct { i, j, k, l int64 }
@@ -112,43 +112,43 @@ func (p *S4) Get() int64 { return p.l }
 func (p *S4) Put(i int64) { p.l = i }
 
 // func f10() {
-//   s := S4{1, 2, 3, 4};
-//   var i I2 = s;
-//   i.Put(5);
-//   check(i.Get() == 5, "f10 i");
-//   check(s.l == 4, "f10 s");
+//      s := S4{1, 2, 3, 4};
+//      var i I2 = s;
+//      i.Put(5);
+//      check(i.Get() == 5, "f10 i");
+//      check(s.l == 4, "f10 s");
 // }
 
 func f11() {
-  s := S4{1, 2, 3, 4};
-  var i I2 = &s;
-  i.Put(5);
-  check(i.Get() == 5, "f11 i");
-  check(s.l == 5, "f11 s");
+       s := S4{1, 2, 3, 4};
+       var i I2 = &s;
+       i.Put(5);
+       check(i.Get() == 5, "f11 i");
+       check(s.l == 5, "f11 s");
 }
 
 func f12() {
-  s := &S4{1, 2, 3, 4};
-  var i I2 = s;
-  i.Put(5);
-  check(i.Get() == 5, "f12 i");
-  check(s.l == 5, "f12 s");
+       s := &S4{1, 2, 3, 4};
+       var i I2 = s;
+       i.Put(5);
+       check(i.Get() == 5, "f12 i");
+       check(s.l == 5, "f12 s");
 }
 
 func main() {
-  f1();
-  f2();
-  f3();
-//  f4();
-  f5();
-  f6();
-  f7();
-  f8();
-  f9();
-//  f10();
-  f11();
-  f12();
-  if fail > 0 {
-    os.Exit(1)
-  }
+       f1();
+       f2();
+       f3();
+//     f4();
+       f5();
+       f6();
+       f7();
+       f8();
+       f9();
+//     f10();
+       f11();
+       f12();
+       if fail > 0 {
+               os.Exit(1)
+       }
 }
index 5a59de1c0e4240dc4ab2936e4b76af756b368798..2905e08c548af8ae1b805ef1f802694ebc336ad5 100644 (file)
@@ -17,7 +17,7 @@ func
 r(c chan int, m int)
 {
        for {
-               select {
+               select {
                case r := <- c:
                        if h[r] != 1 {
                                panicln("r",
@@ -28,7 +28,7 @@ r(c chan int, m int)
                        }
                        h[r] = 2;
                }
-        }
+       }
 }
 
 func
index 34d7d430b4508250503dcb4475f32680ca50a6a9..5801975eb39549ab2bce2c9f31a926f2f732b412 100644 (file)
@@ -4,7 +4,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-
 package main
 
 import "rand"
index 7a9ebed0e4fabefcff3695125dccfee38c07db96..ad720f448be9315051eefe88cc949b59dbd7342c 100644 (file)
@@ -4,7 +4,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-
 package main
 
 import "rand"
index c88607d425d8415c7d50be5e4b2829c4827aa8eb..b6aacfea4d73b797a6271720091ffe9034d6b2c1 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errchk $G $D/$F.go
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 5dc98d75bad2e82baeaf87db86708ce31bc92460..2bbac60a0da828174f64793798af4efc970aef1b 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -1,8 +1,9 @@
-#!/bin/sh
 # Copyright 2009 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
+#!/bin/sh
+
 case X"$GOARCH" in
 Xamd64)
        export A=6
index e163456176d05b134b122bc83cc83b3a9a682b97..ec2ce446e53cc3670b5669b43728c625134d07ed 100644 (file)
@@ -38,5 +38,5 @@ func Sieve() {
 }
 
 func main() {
-  Sieve()
+       Sieve()
 }
index 18f539dce605852a2b231e9918c876736a5d2491..e9e7cff23e4de69d83aeff516812cd451c18b053 100644 (file)
@@ -68,14 +68,14 @@ func main() {
               "\a\b\f\n\r\t\v\\\"",
               "backslashes");
        assert("\\a\\b\\f\\n\\r\\t\\v\\\\\\\"",
-              `\a\b\f\n\r\t\v\\\"`,
+               `\a\b\f\n\r\t\v\\\"`,
               "backslashes (backquote)");
        assert("\x00\x53\000\xca\376S몾몾",
-              "\000\123\x00\312\xFE\u0053\ubabe\U0000babe",
-                  "backslashes 2");
+               "\000\123\x00\312\xFE\u0053\ubabe\U0000babe",
+               "backslashes 2");
        assert("\\000\\123\\x00\\312\\xFE\\u0123\\ubabe\\U0000babe",
-              `\000\123\x00\312\xFE\u0123\ubabe\U0000babe`,
-           "backslashes 2 (backquote)");
+               `\000\123\x00\312\xFE\u0123\ubabe\U0000babe`,
+               "backslashes 2 (backquote)");
        assert("\\x\\u\\U\\", `\x\u\U\`, "backslash 3 (backquote)");
 
        // test large runes. perhaps not the most logical place for this test.
index 6169e973b8ec085a5f41f9adc975557aef89a41c..5d5b3a3b8c96449d75591a52f4d9c790e1d56bc4 100644 (file)
@@ -6,10 +6,10 @@
 
 package main
 
-import(
-        "fmt";
-        "os";
-        "utf8";
+import (
+       "fmt";
+       "os";
+       "utf8";
 )
 
 func main() {
index 95d225444fa1d8854e2b4fd128c291dfdccd8245..9e2021485d7c21da1563e1bf4c2957187f1e725c 100644 (file)
@@ -7,77 +7,77 @@
 package main
 
 const
-  a_const = 0
+       a_const = 0
 
 const (
-  pi = /* the usual */ 3.14159265358979323;
-  e = 2.718281828;
-  mask1 int = 1 << iota;
-  mask2 = 1 << iota;
-  mask3 = 1 << iota;
-  mask4 = 1 << iota;
+       pi = /* the usual */ 3.14159265358979323;
+       e = 2.718281828;
+       mask1 int = 1 << iota;
+       mask2 = 1 << iota;
+       mask3 = 1 << iota;
+       mask4 = 1 << iota;
 )
 
 type (
-  Empty interface {};
-  Point struct {
-    x, y int;
-  };
-  Point2 Point
+       Empty interface {};
+       Point struct {
+               x, y int;
+       };
+       Point2 Point
 )
 
 func (p *Point) Initialize(x, y int) *Point {
-  p.x, p.y = x, y;
-  return p;
+       p.x, p.y = x, y;
+       return p;
 }
 
 func (p *Point) Distance() int {
-  return p.x * p.x + p.y * p.y;
+       return p.x * p.x + p.y * p.y;
 }
 
 var (
-  x1 int;
-  x2 int;
-  u, v, w float
+       x1 int;
+       x2 int;
+       u, v, w float
 )
 
 func foo() {}
 
 func min(x, y int) int {
-  if x < y { return x; }
-  return y;
+       if x < y { return x; }
+       return y;
 }
 
 func swap(x, y int) (u, v int) {
-  u = y;
-  v = x;
-  return;
+       u = y;
+       v = x;
+       return;
 }
 
 func control_structs() {
-  var p *Point = new(Point).Initialize(2, 3);
-  i := p.Distance();
-  var f float = 0.3;
-  for {}
-  for {};
-  for j := 0; j < i; j++ {
-    if i == 0 {
-    } else i = 0;
-    var x float;
-  }
-  foo:  // a label
-  var j int;
-  switch y := 0; true {
-  case i < y:
-    fallthrough;
-  case i < j:
-  case i == 0, i == 1, i == j:
-    i++; i++;
-    goto foo;
-  default:
-    i = -+-+i;
-    break;
-  }
+       var p *Point = new(Point).Initialize(2, 3);
+       i := p.Distance();
+       var f float = 0.3;
+       for {}
+       for {};
+       for j := 0; j < i; j++ {
+               if i == 0 {
+               } else i = 0;
+               var x float;
+       }
+       foo:    // a label
+       var j int;
+       switch y := 0; true {
+       case i < y:
+               fallthrough;
+       case i < j:
+       case i == 0, i == 1, i == j:
+               i++; i++;
+               goto foo;
+       default:
+               i = -+-+i;
+               break;
+       }
 }
 
 func main() {
index a494100514a08a71d748faa141f3cb33adfee882..004f9c01b2c69cff06443469d655062896c0f3de 100644 (file)
@@ -7,14 +7,14 @@
 package main
 
 func main() {
-   var x int = 1;
-   if x != 1 { panic("found ", x, ", expected 1\n"); }
-   {
-          var x int = x + 1;
-          if x != 2 { panic("found ", x, ", expected 2\n"); }
-   }
-   {
-          x := x + 1;
-          if x != 2 { panic("found ", x, ", expected 2\n"); }
-   }
+       var x int = 1;
+       if x != 1 { panic("found ", x, ", expected 1\n"); }
+       {
+               var x int = x + 1;
+               if x != 2 { panic("found ", x, ", expected 2\n"); }
+       }
+       {
+               x := x + 1;
+               if x != 2 { panic("found ", x, ", expected 2\n"); }
+       }
 }