code: func checkReturnType(fnType, tptType reflect.Type) error {
  	switch fnType.NumOut() {
  	case 2:
  		if fnType.Out(1) != errorType {
  			return fmt.Errorf("expected (optional) second return value from transport constructor to be an error")
  		}
  
  		fallthrough
  	case 1:
  		if !fnType.Out(0).Implements(tptType) {
  			return fmt.Errorf("transport constructor returns %s which doesn't implement %s", fnType.Out(0), tptType)
  		}
  	default:
  		return fmt.Errorf("expected transport constructor to return a transport and, optionally, an error")
  	}
  	return nil
  }
docs: // checks if a function returns either the specified type or the specified type
  // and an error.