Update ch7-13.md
parent
9ca3fd63f0
commit
d280c6c7aa
|
@ -48,11 +48,11 @@ switch语句可以简化if-else链,如果这个if-else链对一连串值做相
|
||||||
|
|
||||||
```go
|
```go
|
||||||
switch x.(type) {
|
switch x.(type) {
|
||||||
case nil: // ...
|
case nil: // ...
|
||||||
case int, uint: // ...
|
case int, uint: // ...
|
||||||
case bool: // ...
|
case bool: // ...
|
||||||
case string: // ...
|
case string: // ...
|
||||||
default: // ...
|
default: // ...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue