commit
60b07034bb
@ -42,7 +42,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// A type `switch` compares types instead of values. You
|
// A type `switch` compares types instead of values. You
|
||||||
// can use this to discover the the type of an interface
|
// can use this to discover the type of an interface
|
||||||
// value. In this example, the variable `t` will have the
|
// value. In this example, the variable `t` will have the
|
||||||
// type corresponding to its clause.
|
// type corresponding to its clause.
|
||||||
whatAmI := func(i interface{}) {
|
whatAmI := func(i interface{}) {
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
d255a1fe931fe471b745aeb66830b10216617479
|
b47004b3e3b6d787ea98642dc5b955df57cd2bcd
|
||||||
kxkBPpY_ue
|
TJ4Az0KuLfL
|
||||||
|
@ -40,7 +40,7 @@ branches.</p>
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="code leading">
|
<td class="code leading">
|
||||||
<a href="http://play.golang.org/p/kxkBPpY_ue"><img title="Run code" src="play.png" class="run" /></a>
|
<a href="http://play.golang.org/p/TJ4Az0KuLfL"><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>
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ to express if/else logic. Here we also show how the
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="docs">
|
<td class="docs">
|
||||||
<p>A type <code>switch</code> compares types instead of values. You
|
<p>A type <code>switch</code> compares types instead of values. You
|
||||||
can use this to discover the the type of an interface
|
can use this to discover the type of an interface
|
||||||
value. In this example, the variable <code>t</code> will have the
|
value. In this example, the variable <code>t</code> will have the
|
||||||
type corresponding to its clause.</p>
|
type corresponding to its clause.</p>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user