code: func IsPermanentError(err error) bool {
  	if err == nil {
  		return false
  	}
  	if perr, ok := err.(PermanentError); ok {
  		return perr.IsPermanent()
  	}
  	if cerr := errors.Cause(err); cerr != err {
  		return IsPermanentError(cerr)
  	}
  	return false
  }
docs: // IsPermanentError returns true if the given error is a permanent error. Permanent
  // errors are those that implements the `PermanentError` interface and returns
  // `true` for the `IsPermanent` method.