clarify a comment w.r.t. empty slice (#571)

* fix: Added go for routines - Correct doc

* fix: applied PR reviews

* fix: build file
This commit is contained in:
hudem1
2025-02-08 23:47:55 +01:00
committed by GitHub
parent 9f92e064a1
commit a0afe45ff3
3 changed files with 5 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ func main() {
var s []string
fmt.Println("uninit:", s, s == nil, len(s) == 0)
// To create an empty slice with non-zero length, use
// To create a slice with non-zero length, use
// the builtin `make`. Here we make a slice of
// `string`s of length `3` (initially zero-valued).
// By default a new slice's capacity is equal to its

View File

@@ -1,2 +1,2 @@
522c14373ae9581dd3001be32530cdf940637646
kiy1StxorBF
891d4ef82ef90184a5e1f0f24b6cb2fcc2f58e6e
L9rtMOCQOVn

4
public/slices generated
View File

@@ -45,7 +45,7 @@ a more powerful interface to sequences than arrays.</p>
</td>
<td class="code leading">
<a href="https://go.dev/play/p/kiy1StxorBF"><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/L9rtMOCQOVn"><img title="Run code" src="play.png" class="run" /></a><img title="Copy code" src="clipboard.png" class="copy" />
<pre class="chroma"><code><span class="line"><span class="cl"><span class="kn">package</span> <span class="nx">main</span></span></span></code></pre>
</td>
</tr>
@@ -90,7 +90,7 @@ length 0.</p>
<tr>
<td class="docs">
<p>To create an empty slice with non-zero length, use
<p>To create a slice with non-zero length, use
the builtin <code>make</code>. Here we make a slice of
<code>string</code>s of length <code>3</code> (initially zero-valued).
By default a new slice&rsquo;s capacity is equal to its