Skip to content

Commit

Permalink
Update reflection.md to use Pointer instead of Ptr (#701)
Browse files Browse the repository at this point in the history
According to the source of Go, Pointer is the new name for the pointer kind.
  • Loading branch information
Luís M authored Sep 28, 2023
1 parent 3252bc6 commit bb045d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reflection.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ panic: reflect: call of reflect.Value.NumField on ptr Value [recovered]
func walk(x interface{}, fn func(input string)) {
val := reflect.ValueOf(x)

if val.Kind() == reflect.Ptr {
if val.Kind() == reflect.Pointer {
val = val.Elem()
}

Expand Down Expand Up @@ -453,7 +453,7 @@ func walk(x interface{}, fn func(input string)) {
func getValue(x interface{}) reflect.Value {
val := reflect.ValueOf(x)

if val.Kind() == reflect.Ptr {
if val.Kind() == reflect.Pointer {
val = val.Elem()
}

Expand Down

0 comments on commit bb045d7

Please sign in to comment.