Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
d2829faa
Commit
d2829faa
authored
Oct 28, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
files that are okay from the last gofmt round
R=gri
http://go/go-review/1015011
parent
58ee1f5d
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
53 additions
and
68 deletions
+53
-68
nrdiv_test.go
src/pkg/bignum/nrdiv_test.go
+1
-1
buffer_test.go
src/pkg/bytes/buffer_test.go
+3
-3
bytes_test.go
src/pkg/bytes/bytes_test.go
+6
-10
file.go
src/pkg/debug/elf/file.go
+1
-1
proc_linux.go
src/pkg/debug/proc/proc_linux.go
+8
-16
doc.go
src/pkg/go/doc/doc.go
+4
-4
reader.go
src/pkg/image/png/reader.go
+1
-1
exec.go
src/pkg/os/exec.go
+2
-2
path_test.go
src/pkg/os/path_test.go
+2
-2
path_test.go
src/pkg/path/path_test.go
+10
-12
decimal_test.go
src/pkg/strconv/decimal_test.go
+2
-2
template_test.go
src/pkg/template/template_test.go
+1
-3
time_test.go
src/pkg/time/time_test.go
+3
-3
zoneinfo.go
src/pkg/time/zoneinfo.go
+1
-1
script_test.go
src/pkg/unicode/script_test.go
+4
-3
utf8_test.go
src/pkg/utf8/utf8_test.go
+4
-4
No files found.
src/pkg/bignum/nrdiv_test.go
View file @
d2829faa
...
...
@@ -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
}
src/pkg/bytes/buffer_test.go
View file @
d2829faa
...
...
@@ -5,9 +5,9 @@
package
bytes_test
import
(
.
"bytes"
;
"rand"
;
"testing"
;
.
"bytes"
;
"rand"
;
"testing"
;
)
...
...
src/pkg/bytes/bytes_test.go
View file @
d2829faa
...
...
@@ -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
{
...
...
src/pkg/debug/elf/file.go
View file @
d2829faa
...
...
@@ -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
};
}
...
...
src/pkg/debug/proc/proc_linux.go
View file @
d2829faa
...
...
@@ -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
;
}
...
...
src/pkg/go/doc/doc.go
View file @
d2829faa
...
...
@@ -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.
}
}
}
...
...
src/pkg/image/png/reader.go
View file @
d2829faa
...
...
@@ -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
];
...
...
src/pkg/os/exec.go
View file @
d2829faa
...
...
@@ -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.
}
...
...
src/pkg/os/path_test.go
View file @
d2829faa
...
...
@@ -5,8 +5,8 @@
package
os_test
import
(
.
"os"
;
"testing"
;
.
"os"
;
"testing"
;
)
func
TestMkdirAll
(
t
*
testing
.
T
)
{
...
...
src/pkg/path/path_test.go
View file @
d2829faa
...
...
@@ -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
);
...
...
src/pkg/strconv/decimal_test.go
View file @
d2829faa
...
...
@@ -5,8 +5,8 @@
package
strconv_test
import
(
.
"strconv"
;
"testing"
;
.
"strconv"
;
"testing"
;
)
type
shiftTest
struct
{
...
...
src/pkg/template/template_test.go
View file @
d2829faa
...
...
@@ -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
))
};
}
...
...
src/pkg/time/time_test.go
View file @
d2829faa
...
...
@@ -5,9 +5,9 @@
package
time_test
import
(
"os"
;
"testing"
;
.
"time"
;
"os"
;
"testing"
;
.
"time"
;
)
func
init
()
{
...
...
src/pkg/time/zoneinfo.go
View file @
d2829faa
...
...
@@ -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
}
}
...
...
src/pkg/unicode/script_test.go
View file @
d2829faa
...
...
@@ -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"
},
...
...
src/pkg/utf8/utf8_test.go
View file @
d2829faa
...
...
@@ -5,10 +5,10 @@
package
utf8_test
import
(
"bytes"
;
"strings"
;
"testing"
;
.
"utf8"
;
"bytes"
;
"strings"
;
"testing"
;
.
"utf8"
;
)
type
Utf8Map
struct
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment