Copilot commented on code in PR #1120:
URL:
https://github.com/apache/incubator-seata-go/pull/1120#discussion_r3292521632
##########
pkg/util/reflectx/unexpoert_field.go:
##########
@@ -39,7 +39,7 @@ func GetElemDataValue(data interface{}) interface{} {
value := reflect.ValueOf(data)
kind := reflect.TypeOf(data).Kind()
switch kind {
- case reflect.Ptr:
+ case reflect.Pointer:
return value.Elem().Interface()
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). This will not compile and will also break the pointer checks in
this helper. Please switch back to `reflect.Ptr`.
##########
pkg/util/reflectx/reference_service.go:
##########
@@ -37,7 +37,7 @@ func GetReference(service interface{}) string {
switch kind {
case reflect.Struct:
ref = sType.Name()
- case reflect.Ptr:
+ case reflect.Pointer:
sName := sType.Elem().Name()
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). This change will not compile and will break reference
resolution for pointer receivers. Please use `reflect.Ptr`.
##########
pkg/datasource/sql/util/convert.go:
##########
@@ -245,7 +245,7 @@ func convertAssignRows(dest, src interface{}, rows
*ScanRows) error {
// This also allows scanning into user defined types such as "type Int
int64".
// For symmetry, also check for string destination types.
switch dv.Kind() {
- case reflect.Ptr:
+ case reflect.Pointer:
if src == nil {
dv.Set(reflect.Zero(dv.Type()))
return nil
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). This will not compile and breaks handling of pointer
destination values. Please use `reflect.Ptr`.
##########
pkg/saga/statemachine/engine/invoker/local_invoker.go:
##########
@@ -148,7 +148,7 @@ func (l *LocalServiceInvoker) resolveParameters(input
[]any, methodType reflect.
}
func (l *LocalServiceInvoker) convertParam(value any, targetType reflect.Type)
(any, error) {
- if targetType.Kind() == reflect.Ptr {
+ if targetType.Kind() == reflect.Pointer {
elemType := targetType.Elem()
instance := reflect.New(elemType).Interface()
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). This will not compile and will prevent pointer-typed RPC/local
invoker parameters from being converted correctly. Please use `reflect.Ptr`.
##########
pkg/util/convert/convert.go:
##########
@@ -241,7 +241,7 @@ func ConvertAssignRows(dest, src interface{}) error {
// This also allows scanning into user defined types such as "type Int
int64".
// For symmetry, also check for string destination types.
switch dv.Kind() {
- case reflect.Ptr:
+ case reflect.Pointer:
if src == nil {
dv.Set(reflect.Zero(dv.Type()))
return nil
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). This will not compile and will prevent pointer destinations
from being handled correctly in the conversion switch. Please use `reflect.Ptr`.
##########
pkg/datasource/sql/datasource/utils.go:
##########
@@ -107,12 +107,12 @@ func DeepEqual(x, y interface{}) bool {
typy := reflect.ValueOf(y)
switch typx.Kind() {
- case reflect.Ptr:
+ case reflect.Pointer:
typx = typx.Elem()
}
switch typy.Kind() {
- case reflect.Ptr:
+ case reflect.Pointer:
typy = typy.Elem()
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). This will not compile, so `DeepEqual` will fail to build.
Please use `reflect.Ptr` for pointer kinds.
##########
pkg/datasource/sql/util/convert.go:
##########
@@ -212,7 +212,7 @@ func convertAssignRows(dest, src interface{}, rows
*ScanRows) error {
}
dpv := reflect.ValueOf(dest)
- if dpv.Kind() != reflect.Ptr {
+ if dpv.Kind() != reflect.Pointer {
return errors.New("destination not a pointer")
}
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). This will not compile and breaks the destination pointer
validation. Please use `reflect.Ptr`.
##########
pkg/rm/tcc/tcc_service.go:
##########
@@ -234,7 +232,7 @@ func obtainStructValueType(o interface{}) (bool,
reflect.Value, reflect.Type) {
switch v.Kind() {
case reflect.Struct:
return true, v, t
- case reflect.Ptr:
+ case reflect.Pointer:
return true, v.Elem(), t.Elem()
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). This will not compile and breaks pointer handling in
`obtainStructValueType`. Please use `reflect.Ptr`.
##########
pkg/util/convert/convert.go:
##########
@@ -208,7 +208,7 @@ func ConvertAssignRows(dest, src interface{}) error {
}
dpv := reflect.ValueOf(dest)
- if dpv.Kind() != reflect.Ptr {
+ if dpv.Kind() != reflect.Pointer {
return fmt.Errorf("destination not a pointer")
}
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). As written this will not compile and will cause the destination
pointer check to fail. Please revert to `reflect.Ptr`.
##########
pkg/remoting/getty/session_manager.go:
##########
@@ -200,7 +200,7 @@ func (g *SessionManager) getXid(msg interface{}) string {
} else {
msgType := reflect.TypeOf(msg)
msgValue := reflect.ValueOf(msg)
- if msgType.Kind() == reflect.Ptr {
+ if msgType.Kind() == reflect.Pointer {
msgValue = msgValue.Elem()
}
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). This will not compile and will break XID extraction for pointer
messages. Please use `reflect.Ptr`.
##########
pkg/datasource/sql/types/image.go:
##########
@@ -280,7 +280,7 @@ func (c *ColumnImage) GetActualValue() interface{} {
value := reflect.ValueOf(c.Value)
kind := reflect.TypeOf(c.Value).Kind()
switch kind {
- case reflect.Ptr:
+ case reflect.Pointer:
return value.Elem().Interface()
}
Review Comment:
`reflect.Pointer` is not a valid `reflect.Kind` (the pointer kind is
`reflect.Ptr`). This will not compile and breaks dereferencing of pointer
column values. Please use `reflect.Ptr`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]