Run "go fmt" on all .go files

This commit is contained in:
John Gosset
2014-12-09 09:04:26 -05:00
parent 19cbebee5e
commit ac49ca7392
20 changed files with 380 additions and 379 deletions

View File

@@ -1,23 +1,23 @@
package go_koans
func aboutAllocation() {
a := new(int)
*a = 3
assert(*a == __int__) // new() creates a pointer to the given type, like malloc() in C
a := new(int)
*a = 3
assert(*a == __int__) // new() creates a pointer to the given type, like malloc() in C
type person struct {
name string
age int
}
bob := new(person)
assert(bob.age == __int__) // it can allocate memory for custom types as well
type person struct {
name string
age int
}
bob := new(person)
assert(bob.age == __int__) // it can allocate memory for custom types as well
slice := make([]int, 3)
assert(len(slice) == __int__) // make() creates slices of a given length
slice := make([]int, 3)
assert(len(slice) == __int__) // make() creates slices of a given length
slice = make([]int, 3, __positive_int__) // but can also take an optional capacity
assert(cap(slice) == 20)
slice = make([]int, 3, __positive_int__) // but can also take an optional capacity
assert(cap(slice) == 20)
m := make(map[int]string)
assert(len(m) == __int__) // make() also creates maps
m := make(map[int]string)
assert(len(m) == __int__) // make() also creates maps
}