Skip to content

Commit

Permalink
修改 panic 章节
Browse files Browse the repository at this point in the history
  • Loading branch information
fenglc committed Jun 6, 2016
1 parent 72ef77b commit acc5444
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/panic/panic.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// `panic` 意味着有些出乎意料的错误发生。通常我们用它
// 来表示程序正常运行中不应该出现的,后者我么没有处理
// 来表示程序正常运行中不应该出现的,或者我们没有处理
// 好的错误。

package main
Expand All @@ -8,7 +8,7 @@ import "os"

func main() {

// 我们将在真个网站中使用 panic 来检查预期外的错误。这个
// 我们将在这个网站中使用 panic 来检查预期外的错误。这个
// 是唯一一个为 panic 准备的例子。
panic("a problem")

Expand Down
5 changes: 3 additions & 2 deletions examples/panic/panic.hash
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
0a77404b9606918855097bdcda6adae059a7166a
nWYPMt6EBR
383f4d7898ce2cb05174130724b1bef6a28f948c
Forbidden

4 changes: 2 additions & 2 deletions examples/panic/panic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ main.main()
...
exit status 2

# 注意,不像有些语言中处理多个错误那样,在 Go 中习惯使用错
# 误码返回任意可能的值
# 注意,不像在有些语言中使用异常处理错误,在 Go 中则习惯通过
# 返回值来标示错误
8 changes: 4 additions & 4 deletions panic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h2><a href="../">Go by Example 中文</a>:Panic</h2>

<tr>
<td class="docs">
<p><code>panic</code> 意味着有些出乎意料的错误发生。通常我们用它来表示程序正常运行中不应该出现的,后者我么没有处理好的错误</p>
<p><code>panic</code> 意味着有些出乎意料的错误发生。通常我们用它来表示程序正常运行中不应该出现的,或者我们没有处理好的错误</p>

</td>
<td class="code empty leading">
Expand All @@ -38,7 +38,7 @@ <h2><a href="../">Go by Example 中文</a>:Panic</h2>

</td>
<td class="code leading">
<a href="http://play.golang.org/p/nWYPMt6EBR"><img title="Run code" src="../play.png" class="run" /></a>
<a href="http://play.golang.org/p/Forbidden"><img title="Run code" src="../play.png" class="run" /></a>
<div class="highlight"><pre><span class="kn">package</span> <span class="nx">main</span>
</pre></div>

Expand Down Expand Up @@ -71,7 +71,7 @@ <h2><a href="../">Go by Example 中文</a>:Panic</h2>

<tr>
<td class="docs">
<p>我们将在真个网站中使用 panic 来检查预期外的错误。这个是唯一一个为 panic 准备的例子。</p>
<p>我们将在这个网站中使用 panic 来检查预期外的错误。这个是唯一一个为 panic 准备的例子。</p>

</td>
<td class="code leading">
Expand Down Expand Up @@ -135,7 +135,7 @@ <h2><a href="../">Go by Example 中文</a>:Panic</h2>

<tr>
<td class="docs">
<p>注意,不像有些语言中处理多个错误那样,在 Go 中习惯使用错误码返回任意可能的值</p>
<p>注意,不像在有些语言中使用异常处理错误,在 Go 中则习惯通过返回值来标示错误</p>

</td>
<td class="code empty">
Expand Down

0 comments on commit acc5444

Please sign in to comment.