parent
6bd7615366
commit
ef81b2a729
@ -20,7 +20,7 @@ func main() {
|
||||
// By default a new slice's capacity is equal to its
|
||||
// length; if we know the slice is going to grow ahead
|
||||
// of time, it's possible to pass a capacity explicitly
|
||||
// as an additional parameter ot `make`.
|
||||
// as an additional parameter to `make`.
|
||||
s = make([]string, 3)
|
||||
fmt.Println("emp:", s, "len:", len(s), "cap:", cap(s))
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
cbb10033e4e5d2f26e4b57895313a907072a75d9
|
||||
bqMChdRGpcl
|
||||
9f1302a9c3cf79e5144c4818ea09465ff8d6da57
|
||||
553_cYPVlPH
|
||||
|
4
public/slices
generated
4
public/slices
generated
@ -42,7 +42,7 @@ a more powerful interface to sequences than arrays.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
<a href="https://go.dev/play/p/bqMChdRGpcl"><img title="Run code" src="play.png" class="run" /></a><img title="Copy code" src="clipboard.png" class="copy" />
|
||||
<a href="https://go.dev/play/p/553_cYPVlPH"><img title="Run code" src="play.png" class="run" /></a><img title="Copy code" src="clipboard.png" class="copy" />
|
||||
<pre class="chroma"><span class="kn">package</span> <span class="nx">main</span>
|
||||
</pre>
|
||||
</td>
|
||||
@ -95,7 +95,7 @@ the builtin <code>make</code>. Here we make a slice of
|
||||
By default a new slice’s capacity is equal to its
|
||||
length; if we know the slice is going to grow ahead
|
||||
of time, it’s possible to pass a capacity explicitly
|
||||
as an additional parameter ot <code>make</code>.</p>
|
||||
as an additional parameter to <code>make</code>.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
|
Loading…
x
Reference in New Issue
Block a user