From 373cc5de79fcf98ff70aafb6bf1a9cff090b1c79 Mon Sep 17 00:00:00 2001 From: Hongbo Miao Date: Thu, 12 Mar 2020 18:17:38 +0800 Subject: [PATCH] chore: update switch case code format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 嗯 就是个格式问题,case 前面没有空格。 --- ch5/ch5-09.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ch5/ch5-09.md b/ch5/ch5-09.md index 0d2241f..5885927 100644 --- a/ch5/ch5-09.md +++ b/ch5/ch5-09.md @@ -8,12 +8,12 @@ Go的类型系统会在编译时捕获很多错误,但有些错误只能在运 ```Go switch s := suit(drawCard()); s { - case "Spades": // ... - case "Hearts": // ... - case "Diamonds": // ... - case "Clubs": // ... - default: - panic(fmt.Sprintf("invalid suit %q", s)) // Joker? +case "Spades": // ... +case "Hearts": // ... +case "Diamonds": // ... +case "Clubs": // ... +default: + panic(fmt.Sprintf("invalid suit %q", s)) // Joker? } ```