I have the following code making a request to URL and checking for errors.
import "net/http"
response, err := http.Head("url")
How do check if the error is due to tls handshake timeout? I tried the following:
if err != nil {
tlsError, ok := err.(http.tlsHandshakeTimeoutError)
if ok {
// handle the error
}
}
But I cannot access the http.tlsHandshakeTimeoutError
type because it is unexported. How else can I check for the error type in go?