Response to PR feedback
This commit is contained in:
parent
cb34420198
commit
ed962417b7
@ -37,7 +37,8 @@ func main() {
|
||||
// value from a map indicates if the key was present
|
||||
// in the map. This can be used to disambiguate
|
||||
// between missing keys and keys with zero values
|
||||
// like `0` or `""`.
|
||||
// like `0` or `""`. Here we didn't the value itself, so
|
||||
// we ignored it with the _blank identifier_ `_`.
|
||||
_, prs := m["k2"]
|
||||
fmt.Println("prs:", prs)
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
572365c80895f32241032397bd69094886892d90
|
||||
D-F9YN_V8r
|
||||
ee96724fc32ee253ba2a5390d66d6880d7fdd28f
|
||||
Z2ORjMdW_u
|
||||
|
@ -20,7 +20,7 @@ func main() {
|
||||
// `range` on arrays and slices provides both the
|
||||
// index and value for each entry. Above we didn't
|
||||
// need the index, so we ignored it with the
|
||||
// _blank identifier_ `_`. Sometimes we actually want
|
||||
// blank identifier `_`. Sometimes we actually want
|
||||
// the indexes though.
|
||||
for i, num := range nums {
|
||||
if num == 3 {
|
||||
|
@ -1,2 +1,2 @@
|
||||
e6458150862a6b26e95629ba6a90a6a3036d7d52
|
||||
Ys3V-ohVRy
|
||||
67d7882d364517608741e4045aa10ba489b37987
|
||||
u2yg3m1eFT
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
<a href="http://play.golang.org/p/D-F9YN_V8r"><img title="Run code" src="play.png" class="run" /></a>
|
||||
<a href="http://play.golang.org/p/Z2ORjMdW_u"><img title="Run code" src="play.png" class="run" /></a>
|
||||
<div class="highlight"><pre><span class="kn">package</span> <span class="nx">main</span>
|
||||
</pre></div>
|
||||
|
||||
@ -166,7 +166,8 @@ The optional second return value when getting a
|
||||
value from a map indicates if the key was present
|
||||
in the map. This can be used to disambiguate
|
||||
between missing keys and keys with zero values
|
||||
like <code>0</code> or <code>""</code>.</p>
|
||||
like <code>0</code> or <code>""</code>. Here we didn’t the value itself, so
|
||||
we ignored it with the <em>blank identifier</em> <code>_</code>.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
|
@ -41,7 +41,7 @@ of the data structures we’ve already learned.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
<a href="http://play.golang.org/p/Ys3V-ohVRy"><img title="Run code" src="play.png" class="run" /></a>
|
||||
<a href="http://play.golang.org/p/u2yg3m1eFT"><img title="Run code" src="play.png" class="run" /></a>
|
||||
<div class="highlight"><pre><span class="kn">package</span> <span class="nx">main</span>
|
||||
</pre></div>
|
||||
|
||||
@ -96,7 +96,7 @@ Arrays work like this too.</p>
|
||||
<p><code>range</code> on arrays and slices provides both the
|
||||
index and value for each entry. Above we didn’t
|
||||
need the index, so we ignored it with the
|
||||
<em>blank identifier</em> <code>_</code>. Sometimes we actually want
|
||||
blank identifier <code>_</code>. Sometimes we actually want
|
||||
the indexes though.</p>
|
||||
|
||||
</td>
|
||||
|
Loading…
x
Reference in New Issue
Block a user