Add missing word
This commit is contained in:
parent
310c3f641d
commit
7f27da9e7a
@ -37,8 +37,9 @@ func main() {
|
|||||||
// value from a map indicates if the key was present
|
// value from a map indicates if the key was present
|
||||||
// in the map. This can be used to disambiguate
|
// in the map. This can be used to disambiguate
|
||||||
// between missing keys and keys with zero values
|
// between missing keys and keys with zero values
|
||||||
// like `0` or `""`. Here we didn't the value itself, so
|
// like `0` or `""`. Here we didn't need the value
|
||||||
// we ignored it with the _blank identifier_ `_`.
|
// itself, so we ignored it with the _blank identifier_
|
||||||
|
// `_`.
|
||||||
_, prs := m["k2"]
|
_, prs := m["k2"]
|
||||||
fmt.Println("prs:", prs)
|
fmt.Println("prs:", prs)
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
ee96724fc32ee253ba2a5390d66d6880d7fdd28f
|
2895d63b87f88ab374256c12dd1539cf7b070b77
|
||||||
Z2ORjMdW_u
|
E6cGoiKqka
|
||||||
|
12
public/maps
12
public/maps
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="code leading">
|
<td class="code leading">
|
||||||
<a href="http://play.golang.org/p/Z2ORjMdW_u"><img title="Run code" src="play.png" class="run" /></a>
|
<a href="http://play.golang.org/p/E6cGoiKqka"><img title="Run code" src="play.png" class="run" /></a>
|
||||||
<div class="highlight"><pre><span class="kn">package</span> <span class="nx">main</span>
|
<div class="highlight"><pre><span class="kn">package</span> <span class="nx">main</span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
@ -159,15 +159,13 @@ a map.</p>
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="docs">
|
<td class="docs">
|
||||||
<p> Above we didn’t
|
<p>The optional second return value when getting a
|
||||||
need the index, so we ignored it with the
|
|
||||||
<em>blank identifier</em> <code>_</code>.
|
|
||||||
The optional second return value when getting a
|
|
||||||
value from a map indicates if the key was present
|
value from a map indicates if the key was present
|
||||||
in the map. This can be used to disambiguate
|
in the map. This can be used to disambiguate
|
||||||
between missing keys and keys with zero values
|
between missing keys and keys with zero values
|
||||||
like <code>0</code> or <code>""</code>. Here we didn’t the value itself, so
|
like <code>0</code> or <code>""</code>. Here we didn’t need the value
|
||||||
we ignored it with the <em>blank identifier</em> <code>_</code>.</p>
|
itself, so we ignored it with the <em>blank identifier</em>
|
||||||
|
<code>_</code>.</p>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="code leading">
|
<td class="code leading">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user