mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-12-17 19:24:19 +08:00
ch11: fix code path
This commit is contained in:
@@ -19,8 +19,8 @@ func TestLog(t *testing.T) { /* ... */ }
|
||||
|
||||
其中 t 參數用於報告測試失敗和附件的日誌信息. 讓我們頂一個一個實例包 gopl.io/ch11/word1, 隻有一個函數 IsPalindrome 用於檢査一個字符串是否從前向後和從後向前讀都一樣. (這個實現對於一個字符串是否是迴文字符串前後重複測試了兩次; 我們稍後會再討論這個問題.)
|
||||
|
||||
<u><i>gopl.io/ch11/word1</i></u>
|
||||
```Go
|
||||
gopl.io/ch11/word1
|
||||
// Package word provides utilities for word games.
|
||||
package word
|
||||
|
||||
@@ -143,8 +143,8 @@ FAIL gopl.io/ch11/word1 0.014s
|
||||
|
||||
針對上述兩個BUG, 我們仔細重寫了函數:
|
||||
|
||||
<u><i>gopl.io/ch11/word2</i></u>
|
||||
```Go
|
||||
gopl.io/ch11/word2
|
||||
// Package word provides utilities for word games.
|
||||
package word
|
||||
|
||||
@@ -229,4 +229,3 @@ ok gopl.io/ch11/word2 0.015s
|
||||
{% include "./ch11-02-5.md" %}
|
||||
|
||||
{% include "./ch11-02-6.md" %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user