Go の宿題片付けます

このエントリーをはてなブックマークに追加
59デフォルトの名無しさん
Go part2
http://pc12.2ch.net/test/read.cgi/tech/1258183436/520

> 520 名前:デフォルトの名無しさん[sage] 投稿日:2009/11/18(水) 23:38:35
> よし
> 厨っぽいけど話のタネに並列ダウンローダでも書いてくれ

からの続きです。現在までの成果物

package "main"
import (
'os";
"http";
"fmt";
)
func main() {
  //response, url, err := http.Get("http://www.example.com/");
  response, _, _ := http.Get("http://www.example.com/");
  fmt.Printf("Status: %s\n", response.Status);
  fmt.Printf("StatusCode: %d\n", response.StatusCode);
  fmt.Printf("Header: %v\n", response.Header);
  // fmt.Printf("Body: %s\n", response.Body([0:50]); <- まちがい
}