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