ch10: fix code path

pull/1/head
chai2010 2016-01-20 23:08:50 +08:00
parent c683de9b81
commit 442dd58ee4
2 changed files with 2 additions and 3 deletions

View File

@ -10,8 +10,8 @@ import _ "image/png" // register PNG decoder
標準庫的image圖像包包含了一個`Decode`函數,用於從`io.Reader`接口讀取數據併解碼圖像它調用底層註冊的圖像解碼器來完成任務然後返迴image.Image類型的圖像。使用`image.Decode`很容易編寫一個圖像格式的轉換工具,讀取一種格式的圖像,然後編碼爲另一種圖像格式:
<u><i>gopl.io/ch10/jpeg</i></u>
```Go
gopl.io/ch10/jpeg
// The jpeg command reads a PNG image from the standard input
// and writes it as a JPEG image to the standard output.
package main

View File

@ -69,9 +69,8 @@ $ go run quoteargs.go one "two three" four\ five
針對不同操作繫統或CPU的交叉構建也是很簡單的。隻需要設置好目標對應的GOOS和GOARCH然後運行構建命令卽可。下面交叉編譯的程序將輸出它在編譯時操作繫統和CPU類型
<u><i>gopl.io/ch10/cross</i></u>
```Go
gopl.io/ch10/cross
func main() {
fmt.Println(runtime.GOOS, runtime.GOARCH)
}