mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-08-05 07:11:52 +00:00
ch2: fix code path
This commit is contained in:
@@ -59,8 +59,8 @@ fmt.Println(incr(&v)) // "3" (and v is 3)
|
||||
|
||||
指針是實現標準庫中flag包的關鍵技術,它使用命令行參數來設置對應變量的值,而這些對應命令行標誌參數的變量可能會零散分布在整個程序中。爲了説明這一點,在早些的echo版本中,就包含了兩個可選的命令行參數:`-n`用於忽略行尾的換行符,`-s sep`用於指定分隔字符(默認是空格)。下面這是第四個版本,對應包路徑爲gopl.io/ch2/echo4。
|
||||
|
||||
<u><i>gopl.io/ch2/echo4</i></u>
|
||||
```Go
|
||||
gopl.io/ch2/echo4
|
||||
// Echo4 prints its command-line arguments.
|
||||
package main
|
||||
|
||||
@@ -102,4 +102,3 @@ Usage of ./echo4:
|
||||
-s string
|
||||
separator (default " ")
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user