mirror of
https://github.com/golang/go
synced 2024-11-21 21:34:40 -07:00
spec: update spacing to match gofmt, where reasonable.
R=gri, rsc CC=golang-dev https://golang.org/cl/5327053
This commit is contained in:
parent
c6691d1fb4
commit
72a2979ef0
@ -974,7 +974,7 @@ BaseType = Type .
|
|||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
*int
|
*int
|
||||||
*map[string] *chan int
|
*map[string]*chan int
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3 id="Function_types">Function types</h3>
|
<h3 id="Function_types">Function types</h3>
|
||||||
@ -1153,9 +1153,9 @@ failure will cause a <a href="#Run_time_panics">run-time panic</a>.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
map [string] int
|
map[string]int
|
||||||
map [*T] struct { x, y float64 }
|
map[*T]struct{ x, y float64 }
|
||||||
map [string] interface {}
|
map[string]interface{}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -1174,8 +1174,8 @@ which takes the map type and an optional capacity hint as arguments:
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
make(map[string] int)
|
make(map[string]int)
|
||||||
make(map[string] int, 100)
|
make(map[string]int, 100)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -1306,8 +1306,8 @@ Given the declarations
|
|||||||
type (
|
type (
|
||||||
T0 []string
|
T0 []string
|
||||||
T1 []string
|
T1 []string
|
||||||
T2 struct { a, b int }
|
T2 struct{ a, b int }
|
||||||
T3 struct { a, c int }
|
T3 struct{ a, c int }
|
||||||
T4 func(int, float64) *T0
|
T4 func(int, float64) *T0
|
||||||
T5 func(x int, y float64) *[]string
|
T5 func(x int, y float64) *[]string
|
||||||
)
|
)
|
||||||
@ -1320,7 +1320,7 @@ these types are identical:
|
|||||||
<pre>
|
<pre>
|
||||||
T0 and T0
|
T0 and T0
|
||||||
[]int and []int
|
[]int and []int
|
||||||
struct { a, b *T5 } and struct { a, b *T5 }
|
struct{ a, b *T5 } and struct{ a, b *T5 }
|
||||||
func(x int, y float64) *[]string and func(int, float64) (result *[]string)
|
func(x int, y float64) *[]string and func(int, float64) (result *[]string)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
@ -1639,7 +1639,7 @@ it is only incremented after each ConstSpec:
|
|||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
const (
|
const (
|
||||||
bit0, mask0 = 1 << iota, 1 << iota - 1 // bit0 == 1, mask0 == 0
|
bit0, mask0 = 1 << iota, 1<<iota - 1 // bit0 == 1, mask0 == 0
|
||||||
bit1, mask1 // bit1 == 2, mask1 == 1
|
bit1, mask1 // bit1 == 2, mask1 == 1
|
||||||
_, _ // skips iota == 2
|
_, _ // skips iota == 2
|
||||||
bit3, mask3 // bit3 == 8, mask3 == 7
|
bit3, mask3 // bit3 == 8, mask3 == 7
|
||||||
@ -1670,7 +1670,7 @@ TypeSpec = identifier Type .
|
|||||||
type IntArray [16]int
|
type IntArray [16]int
|
||||||
|
|
||||||
type (
|
type (
|
||||||
Point struct { x, y float64 }
|
Point struct{ x, y float64 }
|
||||||
Polar Point
|
Polar Point
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -3517,7 +3517,7 @@ order.
|
|||||||
For example, in the assignment
|
For example, in the assignment
|
||||||
</p>
|
</p>
|
||||||
<pre>
|
<pre>
|
||||||
y[f()], ok = g(h(), i() + x[j()], <-c), k()
|
y[f()], ok = g(h(), i()+x[j()], <-c), k()
|
||||||
</pre>
|
</pre>
|
||||||
<p>
|
<p>
|
||||||
the function calls and communication happen in the order
|
the function calls and communication happen in the order
|
||||||
@ -4247,7 +4247,7 @@ for { // send random sequence of bits to c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
select { } // block forever
|
select {} // block forever
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
@ -4647,7 +4647,7 @@ is negative or larger than <code>m</code>, or if <code>n</code> or
|
|||||||
s := make([]int, 10, 100) // slice with len(s) == 10, cap(s) == 100
|
s := make([]int, 10, 100) // slice with len(s) == 10, cap(s) == 100
|
||||||
s := make([]int, 10) // slice with len(s) == cap(s) == 10
|
s := make([]int, 10) // slice with len(s) == cap(s) == 10
|
||||||
c := make(chan int, 10) // channel with a buffer size of 10
|
c := make(chan int, 10) // channel with a buffer size of 10
|
||||||
m := make(map[string] int, 100) // map with initial space for 100 elements
|
m := make(map[string]int, 100) // map with initial space for 100 elements
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user