mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-10-17 20:42:50 +00:00
chore: update switch case code format
嗯 就是个格式问题,case 前面没有空格。
This commit is contained in:
@@ -8,12 +8,12 @@ Go的类型系统会在编译时捕获很多错误,但有些错误只能在运
|
|||||||
|
|
||||||
```Go
|
```Go
|
||||||
switch s := suit(drawCard()); s {
|
switch s := suit(drawCard()); s {
|
||||||
case "Spades": // ...
|
case "Spades": // ...
|
||||||
case "Hearts": // ...
|
case "Hearts": // ...
|
||||||
case "Diamonds": // ...
|
case "Diamonds": // ...
|
||||||
case "Clubs": // ...
|
case "Clubs": // ...
|
||||||
default:
|
default:
|
||||||
panic(fmt.Sprintf("invalid suit %q", s)) // Joker?
|
panic(fmt.Sprintf("invalid suit %q", s)) // Joker?
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user