mirror of
https://github.com/golang/go
synced 2024-11-25 03:07:56 -07:00
files that are okay from the last gofmt round
R=gri http://go/go-review/1015011
This commit is contained in:
parent
58ee1f5d54
commit
d2829faa7c
@ -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
|
||||
}
|
||||
|
@ -5,9 +5,9 @@
|
||||
package bytes_test
|
||||
|
||||
import (
|
||||
. "bytes";
|
||||
"rand";
|
||||
"testing";
|
||||
. "bytes";
|
||||
"rand";
|
||||
"testing";
|
||||
)
|
||||
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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};
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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];
|
||||
|
@ -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.
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
package os_test
|
||||
|
||||
import (
|
||||
. "os";
|
||||
"testing";
|
||||
. "os";
|
||||
"testing";
|
||||
)
|
||||
|
||||
func TestMkdirAll(t *testing.T) {
|
||||
|
@ -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);
|
||||
|
@ -5,8 +5,8 @@
|
||||
package strconv_test
|
||||
|
||||
import (
|
||||
. "strconv";
|
||||
"testing";
|
||||
. "strconv";
|
||||
"testing";
|
||||
)
|
||||
|
||||
type shiftTest struct {
|
||||
|
@ -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)) };
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,9 +5,9 @@
|
||||
package time_test
|
||||
|
||||
import (
|
||||
"os";
|
||||
"testing";
|
||||
. "time";
|
||||
"os";
|
||||
"testing";
|
||||
. "time";
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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"},
|
||||
|
@ -5,10 +5,10 @@
|
||||
package utf8_test
|
||||
|
||||
import (
|
||||
"bytes";
|
||||
"strings";
|
||||
"testing";
|
||||
. "utf8";
|
||||
"bytes";
|
||||
"strings";
|
||||
"testing";
|
||||
. "utf8";
|
||||
)
|
||||
|
||||
type Utf8Map struct {
|
||||
|
Loading…
Reference in New Issue
Block a user