I can’t understand why the compiler gives the error multiple-value http.Get() in single-value context Code:
func http_crack() { //full-headers example // HTTP/1.x 200 OK // Date: Sat, 12 Dec 2009 15:41:52 GMT // Server: Apache/2.0.61 (Unix) mod_ssl/2.0.61 OpenSSL/0.9.8k mod_dp20/0.99.2 PHP/5.2.5 mod_python/3.3.1 Python/2.5.1 mod_ruby/1.2.6 Ruby/1.8.6(2007-09-24) // X-Powered-By: PHP/5.2.5 // Set-Cookie: PHPSESSID=ft47gokfee6amv3eda3k1p93s3; path=/ // Expires: Thu, 19 Nov 1981 08:52:00 GMT // Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 // Pragma: no-cache // Keep-Alive: timeout=10, max=1024 // Connection: Keep-Alive // Transfer-Encoding: chunked // Content-Type: text/html response := http.Get(os.Args[1]) response.Header.Set("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko") response.Header.Set("Referer", "http://127.0.0.1/foo-bar/index.html") response.Header.Set("Content-Type", "application/x-www-form-urlencoded; param=value") t_time := time.Now() if response.StatusCode == 200 { fmt.Println(t.Format(time.RFC3339), "OK") } else { fmt.Println(t.Format(time.RFC3339), "BAD") } } How to get around it?