Skip to content

Commit b622e1f

Browse files
committed
change reflect.Ptr and PtrTo to Pointer and PointerTo
Ptr and PtrTo are old names for Pointer and PointerTo.
1 parent 16d3b52 commit b622e1f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pkg/unpack/reflector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func (r Reflector) unpackVal(toVal reflect.Value, from any) error {
160160
if toVal.Type().NumMethod() != 0 && toVal.CanInterface() {
161161
if _, ok := from.(string); ok {
162162
if typ := toVal.Type(); typ.Implements(textUnmarshalerType) ||
163-
reflect.PtrTo(typ).Implements(textUnmarshalerType) {
163+
reflect.PointerTo(typ).Implements(textUnmarshalerType) {
164164
return nil
165165
}
166166
}
@@ -182,7 +182,7 @@ func (r Reflector) unpackVal(toVal reflect.Value, from any) error {
182182
if err := assign(toVal, reflect.ValueOf(child)); err != nil {
183183
return err
184184
}
185-
case reflect.Ptr:
185+
case reflect.Pointer:
186186
var elem reflect.Value
187187
if toVal.IsNil() {
188188
elem = reflect.New(toVal.Type().Elem())

sup/marshal.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ func (m *MarshalBSUPContext) encodeAny(v reflect.Value) (super.Type, error) {
330330
return super.TypeIP, nil
331331
}
332332
return m.encodeRecord(v)
333-
case reflect.Ptr:
333+
case reflect.Pointer:
334334
if v.IsNil() {
335335
return m.encodeNil(v.Type())
336336
}
@@ -427,7 +427,7 @@ func (m *MarshalBSUPContext) encodeRecord(sval reflect.Value) (super.Type, error
427427
isUnexported := sf.PkgPath != ""
428428
if sf.Anonymous {
429429
t := sf.Type
430-
if t.Kind() == reflect.Ptr {
430+
if t.Kind() == reflect.Pointer {
431431
t = t.Elem()
432432
}
433433
if isUnexported && t.Kind() != reflect.Struct {
@@ -541,7 +541,7 @@ func (m *MarshalBSUPContext) lookupType(t reflect.Type) (super.Type, error) {
541541
if err != nil {
542542
return nil, err
543543
}
544-
case reflect.Ptr:
544+
case reflect.Pointer:
545545
var err error
546546
typ, err = m.lookupType(t.Elem())
547547
if err != nil {
@@ -870,7 +870,7 @@ func indirect(v reflect.Value, val super.Value) (BSUPUnmarshaler, reflect.Value)
870870

871871
func (u *UnmarshalBSUPContext) decodeNull(val super.Value, v reflect.Value) error {
872872
inner := v
873-
for inner.Kind() == reflect.Ptr {
873+
for inner.Kind() == reflect.Pointer {
874874
if inner.IsNil() {
875875
// Set nil elements so we can find the actual type of the underlying
876876
// value. This is not so we can set the type since the outer value
@@ -1093,7 +1093,7 @@ func typeOfTemplate(template any) (reflect.Type, error) {
10931093
if !v.IsValid() {
10941094
return nil, errors.New("invalid template")
10951095
}
1096-
for v.Kind() == reflect.Ptr {
1096+
for v.Kind() == reflect.Pointer {
10971097
v = v.Elem()
10981098
}
10991099
return v.Type(), nil

0 commit comments

Comments
 (0)