]> Cypherpunks repositories - gostls13.git/commitdiff
files that are okay from the last gofmt round
authorRuss Cox <rsc@golang.org>
Wed, 28 Oct 2009 05:47:54 +0000 (22:47 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 28 Oct 2009 05:47:54 +0000 (22:47 -0700)
R=gri
http://go/go-review/1015011

16 files changed:
src/pkg/bignum/nrdiv_test.go
src/pkg/bytes/buffer_test.go
src/pkg/bytes/bytes_test.go
src/pkg/debug/elf/file.go
src/pkg/debug/proc/proc_linux.go
src/pkg/go/doc/doc.go
src/pkg/image/png/reader.go
src/pkg/os/exec.go
src/pkg/os/path_test.go
src/pkg/path/path_test.go
src/pkg/strconv/decimal_test.go
src/pkg/template/template_test.go
src/pkg/time/time_test.go
src/pkg/time/zoneinfo.go
src/pkg/unicode/script_test.go
src/pkg/utf8/utf8_test.go

index af21df2e6dff2c85640b85cf1d95d91181f014ac..5fdc31a77dd2e6c1b95bb6a2832b0d61987067d1 100644 (file)
@@ -190,5 +190,5 @@ func TestNRDiv(t *testing.T) {
        idiv(t, 7484890589595, 7484890589594);
        div(t, Fact(100), Fact(91));
        div(t, Fact(1000), Fact(991));
-//div(t, Fact(10000), Fact(9991));  // takes too long - disabled for now
+       //div(t, Fact(10000), Fact(9991));  // takes too long - disabled for now
 }
index 1082e0a11d6e923e91750601395c7fd81095a968..f82c984685f0034be30564e34fe7324c84b65b6b 100644 (file)
@@ -5,9 +5,9 @@
 package bytes_test
 
 import (
-       .       "bytes";
-               "rand";
-               "testing";
+       . "bytes";
+       "rand";
+       "testing";
 )
 
 
index 094d71186fa373d306b8248d699dbfefe8386844..24ee4bf4d2cf33a9433e1cca7e835097cd595ead 100644 (file)
@@ -5,10 +5,10 @@
 package bytes_test
 
 import (
-       .       "bytes";
-               "strings";
-               "testing";
-               "unicode";
+       . "bytes";
+       "strings";
+       "testing";
+       "unicode";
 )
 
 func eq(a, b []string) bool {
@@ -241,18 +241,14 @@ func TestMap(t *testing.T) {
        // Run a couple of awful growth/shrinkage tests
        a := tenRunes('a');
        // 1.  Grow.  This triggers two reallocations in Map.
-       maxRune := func(rune int) int {
-               return unicode.MaxRune;
-       };
+       maxRune := func(rune int) int { return unicode.MaxRune };
        m := Map(maxRune, Bytes(a));
        expect := tenRunes(unicode.MaxRune);
        if string(m) != expect {
                t.Errorf("growing: expected %q got %q", expect, m);
        }
        // 2. Shrink
-       minRune := func(rune int) int {
-               return 'a';
-       };
+       minRune := func(rune int) int { return 'a' };
        m = Map(minRune, Bytes(tenRunes(unicode.MaxRune)));
        expect = a;
        if string(m) != expect {
index 0b5ff3fa108340b6bad32fdbe412f81f266218f8..7b1d784548bed7aae8d42b738f13e1673147f50e 100644 (file)
@@ -174,7 +174,7 @@ func NewFile(r io.ReaderAt) (*File, os.Error) {
        switch f.Class {
        case ELFCLASS32:
        case ELFCLASS64:
-       // ok
+               // ok
        default:
                return nil, &FormatError{0, "unknown ELF class", f.Class};
        }
index f278ec7277461e566e84845b978aef1d468d2d4e..60a0555e9819b5d94abd81ec39d7f656baf563b5 100644 (file)
@@ -220,7 +220,7 @@ func (e *newThreadError) String() string {
        return fmt.Sprintf("newThread wait wanted pid %v and signal %v, got %v and %v", e.Pid, e.StopSignal(), e.wantPid, e.wantSig);
 }
 
-type ProcessExited struct {}
+type ProcessExited struct{}
 
 func (p ProcessExited) String() string {
        return "process exited";
@@ -449,9 +449,9 @@ func (t *thread) wait() {
                        if err == nil {
                                continue;
                        }
-               // If we failed to continue, just let
-               // the stop go through so we can
-               // update the thread's state.
+                       // If we failed to continue, just let
+                       // the stop go through so we can
+                       // update the thread's state.
                }
                if !<-t.proc.ready {
                        // The monitor exited
@@ -852,12 +852,8 @@ func (t *thread) stepAsync(ready chan os.Error) os.Error {
                return err;
        }
        t.setState(singleStepping);
-       t.onStop(func() {
-               ready <- nil;
-       },
-               func(err os.Error) {
-                       ready <- err;
-               });
+       t.onStop(func() { ready <- nil },
+               func(err os.Error) { ready <- err });
        return nil;
 }
 
@@ -1100,9 +1096,7 @@ func (p *process) WaitStop() os.Error {
                        }
                        p.transitionHandlers.Push(h);
                };
-               h.onErr = func(err os.Error) {
-                       ready <- err;
-               };
+               h.onErr = func(err os.Error) { ready <- err };
                p.transitionHandlers.Push(h);
                return nil;
        });
@@ -1114,9 +1108,7 @@ func (p *process) WaitStop() os.Error {
 }
 
 func (p *process) Stop() os.Error {
-       err := p.do(func() os.Error {
-               return p.stopAsync();
-       });
+       err := p.do(func() os.Error { return p.stopAsync() });
        if err != nil {
                return err;
        }
index 7413bbc4bbb4dd4a7840baa72fb9f4d6957d5e4e..a35ea8c685110ac5f82e545e01359774f07fe8d6 100644 (file)
@@ -35,8 +35,8 @@ type typeDoc struct {
 //
 type docReader struct {
        doc     *ast.CommentGroup;      // package documentation, if any
-       pkgName string;
-       values  *vector.Vector;         // list of *ast.GenDecl (consts and vars)
+       pkgName string;
+       values  *vector.Vector; // list of *ast.GenDecl (consts and vars)
        types   map[string]*typeDoc;
        funcs   map[string]*ast.FuncDecl;
        bugs    *vector.Vector; // list of *ast.CommentGroup
@@ -186,7 +186,7 @@ func (doc *docReader) addFunc(fun *ast.FuncDecl) {
                                if doc.pkgName == "os" && tname == "Error" &&
                                        name != "NewError" && name != "NewSyscallError" {
                                        // not a factory function for os.Error
-                                       doc.funcs[name] = fun;  // treat as ordinary function
+                                       doc.funcs[name] = fun;  // treat as ordinary function
                                        return;
                                }
 
@@ -225,7 +225,7 @@ func (doc *docReader) addDecl(decl ast.Decl) {
                                        // would lose GenDecl documentation if the TypeSpec
                                        // has documentation as well.
                                        doc.addType(&ast.GenDecl{d.Doc, d.Pos(), token.TYPE, noPos, []ast.Spec{spec}, noPos});
-                               // A new GenDecl node is created, no need to nil out d.Doc.
+                                       // A new GenDecl node is created, no need to nil out d.Doc.
                                }
                        }
                }
index 12c59e49c19c24b414b594504aebc6291e7c2d29..c8a2b076b28cbe9592d85267d04dd8d5d5d07ef4 100644 (file)
@@ -226,7 +226,7 @@ func (d *decoder) idatReader(idat io.Reader) os.Error {
                pdat := pr[1:len(pr)];
                switch cr[0] {
                case ftNone:
-               // No-op.
+                       // No-op.
                case ftSub:
                        for i := bpp; i < len(cdat); i++ {
                                cdat[i] += cdat[i-bpp];
index a94a2a84241c3aaf20d2cac384b1c42d2e31c335..79d25b2dc0d5d0de634a429a1c176863c7ecd46a 100644 (file)
@@ -57,8 +57,8 @@ func Exec(argv0 string, argv []string, envv []string) Error {
 
 // Waitmsg stores the information about an exited process as reported by Wait.
 type Waitmsg struct {
-       Pid                     int;    // The process's id.
-       syscall.WaitStatus;     // System-dependent status info.
+       Pid                     int;                    // The process's id.
+       syscall.WaitStatus;                             // System-dependent status info.
        Rusage                  *syscall.Rusage;        // System-dependent resource usage info.
 }
 
index 617d1e7f4d9ba921e90a8dad34d359422f861b6c..61cba30ee8a0f786762e325fc2b3996e7f048288 100644 (file)
@@ -5,8 +5,8 @@
 package os_test
 
 import (
-       .       "os";
-               "testing";
+       . "os";
+       "testing";
 )
 
 func TestMkdirAll(t *testing.T) {
index c895effe75205463e929932796a9be595f91864f..9036cc1858ba1463f2ebca503b410cde8645c577 100644 (file)
@@ -134,9 +134,9 @@ func TestExt(t *testing.T) {
 }
 
 type Node struct {
-       name string;
-       entries []*Node;  // nil if the entry is a file
-       mark int;
+       name    string;
+       entries []*Node;        // nil if the entry is a file
+       mark    int;
 }
 
 var tree = &Node{
@@ -156,13 +156,13 @@ var tree = &Node{
                                                &Node{"u", nil, 0},
                                                &Node{"v", nil, 0},
                                        },
-                                       0
-                               }
+                                       0,
+                               },
                        },
-                       0
-               }
+                       0,
+               },
        },
-       0
+       0,
 }
 
 func walkTree(n *Node, path string, f func(path string, n *Node)) {
@@ -187,9 +187,7 @@ func makeTree(t *testing.T) {
 }
 
 func markTree(n *Node) {
-       walkTree(n, "", func(path string, n *Node) {
-               n.mark++;
-       });
+       walkTree(n, "", func(path string, n *Node) { n.mark++ });
 }
 
 func checkMarks(t *testing.T) {
@@ -210,7 +208,7 @@ func mark(name string) {
        });
 }
 
-type TestVisitor struct {}
+type TestVisitor struct{}
 
 func (v *TestVisitor) VisitDir(path string, d *os.Dir) bool {
        mark(d.Name);
index 470a81e2c95da5ba64b3418099c8ecf5ddd09ec0..31477f1aa53a887d5300a00923e0adab1f668313 100644 (file)
@@ -5,8 +5,8 @@
 package strconv_test
 
 import (
-       .       "strconv";
-               "testing";
+       . "strconv";
+       "testing";
 )
 
 type shiftTest struct {
index b17afd26eb625d5dee53ebfbfa907ab6df318b31..23e21e01341d6386c8f85b40ae76e45caf5cea26 100644 (file)
@@ -59,9 +59,7 @@ func plus1(v interface{}) string {
 }
 
 func writer(f func(interface{}) string) (func(io.Writer, interface{}, string)) {
-       return func(w io.Writer, v interface{}, format string) {
-               io.WriteString(w, f(v));
-       };
+       return func(w io.Writer, v interface{}, format string) { io.WriteString(w, f(v)) };
 }
 
 
index 8a90f5d7a5211f95dfb22b3df85a4809faf911b3..5d9d7c27ebb51336edf8a4204e3e5b001be98278 100644 (file)
@@ -5,9 +5,9 @@
 package time_test
 
 import (
-               "os";
-               "testing";
-       .       "time";
+       "os";
+       "testing";
+       . "time";
 )
 
 func init() {
index b2b719cfd165a73ab3399781aababb83145f3602..86f185dada01636d58bfb4823c462fa3c12e36af 100644 (file)
@@ -217,7 +217,7 @@ func setupZone() {
        case len(tz) > 0:
                zones, _ = readinfofile(zoneDir+tz);
        case len(tz) == 0:
-       // do nothing: use UTC
+               // do nothing: use UTC
        }
 }
 
index c212e3335a3363617240a4f9d9cd0acccc899553..a5d070a498fea5c2eac6bbf6a6e2fe73d0639bf7 100644 (file)
@@ -5,8 +5,8 @@
 package unicode_test
 
 import (
-               "testing";
-       .       "unicode";
+       "testing";
+       . "unicode";
 )
 
 type T struct {
@@ -98,7 +98,8 @@ var inTest = []T{
 }
 
 var outTest = []T{     // not really worth being thorough
-T{0x20, "Telugu"}}
+       T{0x20, "Telugu"},
+}
 
 var inCategoryTest = []T{
        T{0x0081, "Cc"},
index f18eff8d6cc437281105a609ebd80f098829b0c3..dd9e3341225e29a74f22b17eb949e7c9d970ff36 100644 (file)
@@ -5,10 +5,10 @@
 package utf8_test
 
 import (
-               "bytes";
-               "strings";
-               "testing";
-       .       "utf8";
+       "bytes";
+       "strings";
+       "testing";
+       . "utf8";
 )
 
 type Utf8Map struct {