title: Error wrap/unwrap && type checking with errors.Is()
body: <p>I am checking through an error trace in Go v1.13 Go v1.14. Why does it appear that only error implementations without parameters or with value receivers can be found with <code>errors.Is()</code>? This means that an error implementation capable of wrapping must have a value receiver in order to be able to be found with <code>errors.Is()</code>.</p>
  <pre class="lang-golang prettyprint-override"><code>package main
  
  import (
      &quot;fmt&quot;
      &quot;errors&quot;
  )
  
  type someAtomicError struct {}
  func (e *someAtomicError) Error() string { return &quot;Hi!&quot; }
  func checkAtomicError() {
      e := &amp;someAtomicError{}
      e2 := fmt.Errorf(&quot;whoa!: %w&quot;, e)
      e2IsE := errors.Is(e2, &amp;someAtomicError{})
      fmt.Println(&quot;atomic error trace ---\t\t&quot;, e2, &quot;\t\t--- is traceable: &quot;, e2IsE)
  }
  
  
  type someWrapperError struct {
      Msg string
      Err error
  }
  func (e someWrapperError) Error() string { return fmt.Sprintf(&quot;%s: %v&quot;, e.Msg, e.Err) }
  func (e someWrapperError) Unwrap() error { return e.Err }
  func checkWrapperError() {
      e := someWrapperError{&quot;Hi!&quot;, nil}
      e2 := fmt.Errorf(&quot;whoa!: %w&quot;, e)
      e2IsE := errors.Is(e2, someWrapperError{&quot;Hi!&quot;, nil})
      fmt.Println(&quot;wrapper error trace ---\t\t&quot;, e2, &quot;\t--- is traceable: &quot;, e2IsE)
  }
  
  
  type somePointerWrapperError struct {
      Msg string
      Err error
  }
  func (e *somePointerWrapperError) Error() string { return fmt.Sprintf(&quot;%s: %v&quot;, e.Msg, e.Err) }
  func (e *somePointerWrapperError) Unwrap() error { return e.Err }
  func checkPointerWrapperError() {
      e := &amp;somePointerWrapperError{&quot;Hi!&quot;, nil}
      e2 := fmt.Errorf(&quot;whoa!: %w&quot;, e)
      e2IsE := errors.Is(e2, &amp;somePointerWrapperError{&quot;Hi!&quot;, nil})
      fmt.Println(&quot;pointer wrapper error trace ---\t&quot;, e2, &quot;\t--- is traceable: &quot;, e2IsE)
  }
  
  
  func main() {
      checkAtomicError()
      checkWrapperError() 
      checkPointerWrapperError()
  }
  
  //atomic error trace ---         whoa!: Hi!         --- is traceable:  true
  //wrapper error trace ---        whoa!: Hi!: &lt;nil&gt;  --- is traceable:  true
  //pointer wrapper error trace ---    whoa!: Hi!: &lt;nil&gt;  --- is traceable:  false
  </code></pre>
  <p><a href="https://play.golang.org/p/-hSukZ-gii2" rel="noreferrer">https://play.golang.org/p/-hSukZ-gii2</a></p>
  <p>It seems that any difference in parameters, including in the wrapped error parameter, <code>Err</code>, will result in the type being unable to be found with <code>errors.Is()</code>.</p>