Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 05.3.md #310

Merged
merged 2 commits into from
Feb 3, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update 05.3.md
修正书写格式
  • Loading branch information
hitdavid committed Feb 3, 2017
commit 880b346f0a3ede8212ab2584dac107f9e23a3603
2 changes: 1 addition & 1 deletion eBook/05.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ switch var1 {

您可以同时测试多个可能符合条件的值,使用逗号分割它们,例如:`case val1, val2, val3`。

go语言使用快速的查找算法来测试switch条件与case分支的匹配情况,直到匹配到某个case或者进入default条件为止。
每一个 `case` 分支都是唯一的,从上至下逐一测试,直到匹配为止。( Go 语言使用快速的查找算法来测试 switch 条件与 case 分支的匹配情况,直到算法匹配到某个 case 或者进入 default 条件为止。)

一旦成功地匹配到某个分支,在执行完相应代码后就会退出整个 switch 代码块,也就是说您不需要特别使用 `break` 语句来表示结束。

Expand Down