Skip to content

Commit

Permalink
change reflect.Pointer to reflect.Ptr (legacy)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedib0t committed Nov 27, 2024
1 parent 1c67af1 commit 51f98fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions table/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func objAsSlice(in interface{}) []interface{} {
if in != nil {
// dereference pointers
val := reflect.ValueOf(in)
if val.Kind() == reflect.Pointer && !val.IsNil() {
if val.Kind() == reflect.Ptr && !val.IsNil() {
in = val.Elem().Interface()
}

Expand All @@ -82,7 +82,7 @@ func objAsSlice(in interface{}) []interface{} {
for i := 0; i < v.Len(); i++ {
// dereference pointers
v2 := v.Index(i)
if v2.Kind() == reflect.Pointer && !v2.IsNil() {
if v2.Kind() == reflect.Ptr && !v2.IsNil() {
v2 = reflect.ValueOf(v2.Elem().Interface())
}

Expand All @@ -103,7 +103,7 @@ func objAsSlice(in interface{}) []interface{} {
// remove trailing nil pointers
for i := len(out) - 1; i >= 0; i-- {
val := reflect.ValueOf(out[i])
if val.Kind() == reflect.Pointer && val.IsNil() {
if val.Kind() == reflect.Ptr && val.IsNil() {
out = out[:i]
} else {
break
Expand Down

0 comments on commit 51f98fa

Please sign in to comment.