code: func handleReturnValue(out []reflect.Value) (interface{}, error) {
  	switch len(out) {
  	case 2:
  		err := out[1]
  		if err != (reflect.Value{}) && !err.IsNil() {
  			return nil, err.Interface().(error)
  		}
  		fallthrough
  	case 1:
  		tpt := out[0]
  
  		// Check for nil value and nil error.
  		if tpt == (reflect.Value{}) {
  			return nil, fmt.Errorf("unspecified error")
  		}
  		switch tpt.Kind() {
  		case reflect.Ptr, reflect.Interface, reflect.Func:
  			if tpt.IsNil() {
  				return nil, fmt.Errorf("unspecified error")
  			}
  		}
  
  		return tpt.Interface(), nil
  	default:
  		panic("expected 1 or 2 return values from transport constructor")
  	}
  }
docs: // Handles return values with optional errors. That is, return values of the
  // form `(something, error)` or just `something`.
  //
  // Panics if the return value isn't of the correct form.