title: Specifically check for timeout error
body: <p>I use the following to check for timeouts when calling a webservice, but I would like to check specifically if there is a timeout error returned. How do I do that :S</p>
  
  <p>I have this:</p>
  
  <pre><code>// Timeout
  type Timeout struct {
      Connect   time.Duration
      ReadWrite time.Duration
  }
  
  // TimeoutDialer
  func TimeoutDialer(timeout *Timeout) func(net, addr string) (c net.Conn, err error) {
      return func(netw, addr string) (net.Conn, error) {    
          conn, err := net.DialTimeout(netw, addr, timeout.Connect)
          if err != nil {
              return nil, err
          }
          conn.SetDeadline(time.Now().Add(timeout.ReadWrite))
          return conn, nil
      }
  }
  
  // HttpClient
  func HttpClient(config Config) *http.Client {
      to := &amp;Timeout{
          Connect:   time.Duration(config.MaxWait) * time.Second,
          ReadWrite: time.Duration(config.MaxWait) * time.Second,
      }
  
      return &amp;http.Client{
          Transport: &amp;http.Transport{
              Dial: TimeoutDialer(to),
          },
      }
  }
  </code></pre>