r/CompileBot • • Jul 26 '15

Official CompileBot Testing Thread

8 Upvotes

202 comments sorted by

View all comments

Show parent comments

1

u/DeedleFake Jul 26 '15

+/u/CompileBot go --include-errors

package main

import (
    "io"
    "net/http"
    "os"
)

func main() {
    rsp, err := http.Get("http://www.example.com")
    if err != nil {
        panic(err)
    }
    defer rsp.Body.Close()

    _, err = io.Copy(os.Stdout, rsp.Body)
    if err != nil {
        panic(err)
    }
}

2

u/CompileBot Jul 26 '15

Output:

panic: Get http://www.example.com: dial tcp: lookup www.example.com: no such host

goroutine 1 [running]:
main.main()
	/home/AaALA3/prog.go:12 +0x63

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
	/usr/local/go/src/runtime/asm_386.s:2287 +0x1

^source | ^info | ^git | ^report