package main
import "net/http"
func main() {
req, err := http.NewRequest("GET", "http://domain_does_not_exist", nil)
if err != nil { panic("NewRequest") }
client := http.Client{ }
_, err = client.Do(req)
if err == ???
}
I would like to check my GET request for specific error(DNS resolve error). How to accomplish this?