commit
77cf5a60f8
@ -23,7 +23,7 @@ func f1(arg int) (int, error) {
|
||||
|
||||
}
|
||||
|
||||
// A nil value in the error position indicates that
|
||||
// A `nil` value in the error position indicates that
|
||||
// there was no error.
|
||||
return arg + 3, nil
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
07cffb3d4e37162ab7e9e0a192561ddc8042b81a
|
||||
BmDQXkPPTk
|
||||
210ba0f8196006c0380acaec01655816848ef168
|
||||
mP_ZR1qjUvA
|
||||
|
@ -16,7 +16,7 @@ func main() {
|
||||
m["k1"] = 7
|
||||
m["k2"] = 13
|
||||
|
||||
// Printing a map with e.g. `Println` will show all of
|
||||
// Printing a map with e.g. `fmt.Println` will show all of
|
||||
// its key/value pairs.
|
||||
fmt.Println("map:", m)
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
2895d63b87f88ab374256c12dd1539cf7b070b77
|
||||
E6cGoiKqka
|
||||
3e39d07e3f80ecbac558c6fb8baee2a5f914cf97
|
||||
U67R66Oab8r
|
||||
|
@ -30,7 +30,7 @@ func main() {
|
||||
// arrays. One is the builtin `append`, which
|
||||
// returns a slice containing one or more new values.
|
||||
// Note that we need to accept a return value from
|
||||
// append as we may get a new slice value.
|
||||
// `append` as we may get a new slice value.
|
||||
s = append(s, "d")
|
||||
s = append(s, "e", "f")
|
||||
fmt.Println("apd:", s)
|
||||
|
@ -1,2 +1,2 @@
|
||||
d900c3b1cf2bd96591f7ad7ce7fd9e592ec31139
|
||||
dPQErsP6Yc
|
||||
c6fa1627841f199dbf901f88580cb97eb92c5530
|
||||
Z3_U32sn8RF
|
||||
|
@ -8,7 +8,7 @@ package main
|
||||
import "fmt"
|
||||
|
||||
// Here's a function that will take an arbitrary number
|
||||
// of `ints` as arguments.
|
||||
// of `int`s as arguments.
|
||||
func sum(nums ...int) {
|
||||
fmt.Print(nums, " ")
|
||||
total := 0
|
||||
|
@ -1,2 +1,2 @@
|
||||
25bcf8d28adf0587d1959e88f32786d7f21872b2
|
||||
wRPLOM1VIH
|
||||
34ba16069a5d972a837cc5c0172ab30873535220
|
||||
7f0JlVhToDD
|
||||
|
@ -46,7 +46,7 @@ non-error tasks.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
<a href="http://play.golang.org/p/BmDQXkPPTk"><img title="Run code" src="play.png" class="run" /></a>
|
||||
<a href="http://play.golang.org/p/mP_ZR1qjUvA"><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>
|
||||
|
||||
@ -109,7 +109,7 @@ with the given error message.</p>
|
||||
|
||||
<tr>
|
||||
<td class="docs">
|
||||
<p>A nil value in the error position indicates that
|
||||
<p>A <code>nil</code> value in the error position indicates that
|
||||
there was no error.</p>
|
||||
|
||||
</td>
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
<a href="http://play.golang.org/p/E6cGoiKqka"><img title="Run code" src="play.png" class="run" /></a>
|
||||
<a href="http://play.golang.org/p/U67R66Oab8r"><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>
|
||||
|
||||
@ -102,7 +102,7 @@ syntax.</p>
|
||||
|
||||
<tr>
|
||||
<td class="docs">
|
||||
<p>Printing a map with e.g. <code>Println</code> will show all of
|
||||
<p>Printing a map with e.g. <code>fmt.Println</code> will show all of
|
||||
its key/value pairs.</p>
|
||||
|
||||
</td>
|
||||
|
@ -40,7 +40,7 @@ powerful interface to sequences than arrays.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
<a href="http://play.golang.org/p/dPQErsP6Yc"><img title="Run code" src="play.png" class="run" /></a>
|
||||
<a href="http://play.golang.org/p/Z3_U32sn8RF"><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>
|
||||
|
||||
@ -126,7 +126,7 @@ support several more that make them richer than
|
||||
arrays. One is the builtin <code>append</code>, which
|
||||
returns a slice containing one or more new values.
|
||||
Note that we need to accept a return value from
|
||||
append as we may get a new slice value.</p>
|
||||
<code>append</code> as we may get a new slice value.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
|
@ -42,7 +42,7 @@ function.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
<a href="http://play.golang.org/p/wRPLOM1VIH"><img title="Run code" src="play.png" class="run" /></a>
|
||||
<a href="http://play.golang.org/p/7f0JlVhToDD"><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>
|
||||
|
||||
@ -64,7 +64,7 @@ function.</p>
|
||||
<tr>
|
||||
<td class="docs">
|
||||
<p>Here’s a function that will take an arbitrary number
|
||||
of <code>ints</code> as arguments.</p>
|
||||
of <code>int</code>s as arguments.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
|
Loading…
x
Reference in New Issue
Block a user