code: func refuseProto2(typ reflect.Type) error {
  	if typ.Kind() == reflect.Ptr && typ.Elem().Kind() != reflect.Struct {
  		return errNoProto2
  	}
  	return nil
  }
docs: // refuseProto2 returns errNoProto2 if the given typ came from proto2 message.
  //
  // Proto3 use pointers only to represent message-valued fields. Proto2 also
  // uses them to represent scalar-valued fields. We don't support proto2. So
  // check that if typ is a pointer, it points to a struct.