diff --git a/default_schema.go b/default_schema.go index e38c025..ed92fa7 100644 --- a/default_schema.go +++ b/default_schema.go @@ -52,7 +52,7 @@ func simpleKeyToFields(idFieldName string) dal.KeyToFieldsFunc { } } // If value is not a pointer, also check a pointer to it (for pointer receiver methods) - if v.Kind() != reflect.Ptr { + if v.Kind() != reflect.Pointer { pv := reflect.New(v.Type()) if m := pv.MethodByName("SetID"); m.IsValid() { t := m.Type() @@ -60,7 +60,7 @@ func simpleKeyToFields(idFieldName string) dal.KeyToFieldsFunc { return true } } - } else if v.Kind() == reflect.Ptr { + } else if v.Kind() == reflect.Pointer { // Additionally check the element (for value receiver methods) e := v.Elem() if e.IsValid() { @@ -82,7 +82,7 @@ func simpleKeyToFields(idFieldName string) dal.KeyToFieldsFunc { // Check for exported field named `idFieldName` on struct or pointer to struct t := v.Type() - if t.Kind() == reflect.Ptr { + if t.Kind() == reflect.Pointer { t = t.Elem() } if t.Kind() == reflect.Struct { @@ -124,7 +124,7 @@ func simpleFieldsToKey(idFieldName string) dal.DataToKeyFunc { } } // If pointer, also check value receiver; if value, also check pointer receiver - if v.Kind() == reflect.Ptr { + if v.Kind() == reflect.Pointer { e := v.Elem() if e.IsValid() { if m := e.MethodByName("GetID"); m.IsValid() { @@ -159,7 +159,7 @@ func simpleFieldsToKey(idFieldName string) dal.DataToKeyFunc { } // Dereference pointer if needed vt := v.Type() - if vt.Kind() == reflect.Ptr { + if vt.Kind() == reflect.Pointer { v = v.Elem() vt = v.Type() } diff --git a/getter.go b/getter.go index a59a5dc..b84e0e9 100644 --- a/getter.go +++ b/getter.go @@ -317,7 +317,7 @@ func getSelectFields(includePK bool, options DbOptions, records ...dal.Record) ( } val := reflect.ValueOf(data) kind := val.Kind() - if kind == reflect.Ptr || kind == reflect.Interface { + if kind == reflect.Pointer || kind == reflect.Interface { val = val.Elem() } // TODO: throw panic diff --git a/reader_recordset.go b/reader_recordset.go index 2e7aee8..55edd36 100644 --- a/reader_recordset.go +++ b/reader_recordset.go @@ -77,7 +77,7 @@ func getRecordsetReader(ctx context.Context, query dal.Query, execute executeQue case reflect.Interface: // Assume it's a nullable []byte/blob if it's an interface (common for some drivers/sqlmock) c = recordset.UntypedCol(recordset.NewTypedColumn[[]byte](name, nil, dbType)) - case reflect.Ptr: + case reflect.Pointer: elem := scanType.Elem() switch elem.Kind() { case reflect.Uint8: diff --git a/sql.go b/sql.go index 746f249..c0bae01 100644 --- a/sql.go +++ b/sql.go @@ -67,7 +67,7 @@ func buildSingleRecordQuery(o operation, options DbOptions, record dal.Record) ( record.SetError(nil) data := record.Data() val := reflect.ValueOf(data) - if kind := val.Kind(); kind == reflect.Interface || kind == reflect.Ptr { + if kind := val.Kind(); kind == reflect.Interface || kind == reflect.Pointer { val = val.Elem() } valType := val.Type()