title: How to check if an error is "deadline exceeded" error?
body: <p>I'm sending a request with a context which specified with a 10 seconds timeout:</p>
  
  <pre><code>ctx, cancel := context.WithTimeout(context.Background(), time.Second * 10)
  defer cancel()
  _, err := client.SendRequest(ctx)
  if err != nil {
      return 0, err
  }
  </code></pre>
  
  <p>now when I hit that timeout the error message is confusing:</p>
  
  <blockquote>
    <p>context deadline exceeded</p>
  </blockquote>
  
  <p>Is it possible to check if the err is the timeout error so that I can print a nicer error message?</p>
  
  <pre><code>ctx, cancel := context.WithTimeout(context.Background(), time.Second * 10)
  defer cancel()
  _, err := client.SendRequest(ctx)
  if err != nil {
      if isTimeoutError(err) {
         return nil, fmt.Errorf("the request is timeout after 10 seconds") 
      }
      return nil, err
  }
  </code></pre>
  
  <p>How to implement such <code>isTimeoutError</code> function?</p>