Commit d3d3accd authored by Robert Griesemer's avatar Robert Griesemer

gofmt-ify io, json, runtime, encoding

R=rsc
http://go/go-review/1017056
parent 441e775d
......@@ -48,9 +48,15 @@ func WriteFile(filename string, data []byte, perm int) os.Error {
// A dirList implements sort.Interface.
type dirList []*os.Dir
func (d dirList) Len() int { return len(d); }
func (d dirList) Less(i, j int) bool { return d[i].Name < d[j].Name; }
func (d dirList) Swap(i, j int) { d[i], d[j] = d[j], d[i]; }
func (d dirList) Len() int {
return len(d);
}
func (d dirList) Less(i, j int) bool {
return d[i].Name < d[j].Name;
}
func (d dirList) Swap(i, j int) {
d[i], d[j] = d[j], d[i];
}
// ReadDir reads the directory named by dirname and returns
// a list of sorted directory entries.
......
......@@ -113,7 +113,8 @@ func (b *structBuilder) Float64(f float64) {
}
}
func (b *structBuilder) Null() {}
func (b *structBuilder) Null() {
}
func (b *structBuilder) String(s string) {
if b == nil {
......
......@@ -43,9 +43,9 @@ const encoded = `{"t":true,"f":false,"s":"abc","i8":1,"i16":2,"i32":3,"i64":4,`
`"mapptrstruct":{"m1":{"u8":8}}}`
var decodedMap = map[string][]int{
"k1": []int{1,2,3},
"k1": []int{1, 2, 3},
"k2": []int{},
"k3": []int{3,4},
"k3": []int{3, 4},
}
var decodedMapStruct = map[string]myStruct{
......
......@@ -5,7 +5,7 @@
/*
The runtime package contains operations that interact with Go's runtime system,
such as functions to control goroutines.
*/
*/
package runtime
// These functions are implemented in the base runtime library, ../../runtime/.
......
......@@ -21,7 +21,7 @@ import "unsafe"
// compile time; non-empty interface values get created
// during initialization. Type is an empty interface
// so that the compiler can lay out references as data.
type Type interface { }
type Type interface{}
// All types begin with a few common fields needed for
// the interface runtime.
......@@ -125,10 +125,11 @@ type SliceType struct {
// ChanDir represents a channel type's direction.
type ChanDir int
const (
RecvDir ChanDir = 1<<iota; // <-chan
SendDir; // chan<-
BothDir = RecvDir | SendDir; // chan
BothDir = RecvDir|SendDir; // chan
)
// ChanType represents a channel type.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment