This commit is contained in:
Cadey Ratio 2018-12-03 17:44:13 -08:00
parent 0182c05788
commit 4d3aeafa9a
1 changed files with 19 additions and 0 deletions

View File

@ -110,3 +110,22 @@ All of the men spoke fact about the thing, but none of them spoke the truth of w
// after grope switch block
log.Printf("%T", thing) // prints Elephant
```
---
```
switch thing.(type) {
case Trunker:
log.Printf("man %d: this thing is like a thick snake", id)
case Fanner:
log.Printf("man %d: this thing is like a kind of fan", id)
case TreeTrunker:
log.Printf("man %d: this thing is like a tree trunk", id)
case Waller:
log.Printf("man %d: this thing is like a wall", id)
case Roper:
log.Printf("man %d: this thing is like a rope", id)
case Tusker:
log.Printf("man %d: this thing is hard, smooth and like a spear", id)
}
```