[go] reflect: change reflect.Ptr to reflect.Pointer

296 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Apr 26, 2022, 3:55:13 AM4/26/22
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot has uploaded this change for review.

View Change

reflect: change reflect.Ptr to reflect.Pointer

Hello, this is my first PR.
reflect.Ptr is old name of reflect.Pointer.
So I changed it.

Change-Id: Iaddfafbe41d58c0daffe069d718401aa574e7b8e
GitHub-Last-Rev: bafa3f2de321696734866750e0521bbb3858b4f2
GitHub-Pull-Request: golang/go#52564
---
M src/cmd/compile/internal/base/flag.go
M src/cmd/compile/internal/ir/dump.go
M src/cmd/compile/internal/ir/fmt.go
M src/cmd/compile/internal/syntax/dumper.go
M src/flag/flag.go
5 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/cmd/compile/internal/base/flag.go b/src/cmd/compile/internal/base/flag.go
index 49e004c..e9fb4bb 100644
--- a/src/cmd/compile/internal/base/flag.go
+++ b/src/cmd/compile/internal/base/flag.go
@@ -305,7 +305,7 @@
panic(fmt.Sprintf("base.Flag.%s is missing help text", f.Name))
}

- if k := f.Type.Kind(); (k == reflect.Ptr || k == reflect.Func) && v.Field(i).IsNil() {
+ if k := f.Type.Kind(); (k == reflect.Pointer || k == reflect.Func) && v.Field(i).IsNil() {
panic(fmt.Sprintf("base.Flag.%s is uninitialized %v", f.Name, f.Type))
}

diff --git a/src/cmd/compile/internal/ir/dump.go b/src/cmd/compile/internal/ir/dump.go
index 59914ba..11f2c07 100644
--- a/src/cmd/compile/internal/ir/dump.go
+++ b/src/cmd/compile/internal/ir/dump.go
@@ -156,7 +156,7 @@
}
p.dump(x.Elem(), depth-1)

- case reflect.Ptr:
+ case reflect.Pointer:
if x.IsNil() {
p.printf("nil")
return
@@ -258,7 +258,7 @@
return x.Uint() == 0
case reflect.String:
return x.String() == ""
- case reflect.Interface, reflect.Ptr, reflect.Slice:
+ case reflect.Interface, reflect.Pointer, reflect.Slice:
return x.IsNil()
}
return false
diff --git a/src/cmd/compile/internal/ir/fmt.go b/src/cmd/compile/internal/ir/fmt.go
index a00667b..0271a8e 100644
--- a/src/cmd/compile/internal/ir/fmt.go
+++ b/src/cmd/compile/internal/ir/fmt.go
@@ -1209,7 +1209,7 @@
continue
}
switch tf.Type.Kind() {
- case reflect.Interface, reflect.Ptr, reflect.Slice:
+ case reflect.Interface, reflect.Pointer, reflect.Slice:
if vf.IsNil() {
continue
}
@@ -1289,7 +1289,7 @@
}
}
return true
- case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer:
+ case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Pointer, reflect.Slice, reflect.UnsafePointer:
return v.IsNil()
case reflect.String:
return v.Len() == 0
diff --git a/src/cmd/compile/internal/syntax/dumper.go b/src/cmd/compile/internal/syntax/dumper.go
index d524788..1573203 100644
--- a/src/cmd/compile/internal/syntax/dumper.go
+++ b/src/cmd/compile/internal/syntax/dumper.go
@@ -111,7 +111,7 @@
}
p.dump(x.Elem(), nil)

- case reflect.Ptr:
+ case reflect.Pointer:
if x.IsNil() {
p.printf("nil")
return
diff --git a/src/flag/flag.go b/src/flag/flag.go
index a076244..c61b06c 100644
--- a/src/flag/flag.go
+++ b/src/flag/flag.go
@@ -298,11 +298,11 @@

func newTextValue(val encoding.TextMarshaler, p encoding.TextUnmarshaler) textValue {
ptrVal := reflect.ValueOf(p)
- if ptrVal.Kind() != reflect.Ptr {
+ if ptrVal.Kind() != reflect.Pointer {
panic("variable value type must be a pointer")
}
defVal := reflect.ValueOf(val)
- if defVal.Kind() == reflect.Ptr {
+ if defVal.Kind() == reflect.Pointer {
defVal = defVal.Elem()
}
if defVal.Type() != ptrVal.Type().Elem() {

To view, visit change 402314. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Iaddfafbe41d58c0daffe069d718401aa574e7b8e
Gerrit-Change-Number: 402314
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-MessageType: newchange

Gopher Robot (Gerrit)

unread,
Apr 26, 2022, 3:55:39 AM4/26/22
to Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
A maintainer will review your change and provide feedback. See
https://go.dev/doc/contribute#review for more info and tips to get your
patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11 or adds a tag like "wait-release", it means that this CL will be
reviewed as part of the next development cycle. See https://go.dev/s/release
for more details.

View Change

    To view, visit change 402314. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Iaddfafbe41d58c0daffe069d718401aa574e7b8e
    Gerrit-Change-Number: 402314
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Comment-Date: Tue, 26 Apr 2022 07:55:33 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Gopher Robot (Gerrit)

    unread,
    Apr 26, 2022, 3:59:16 AM4/26/22
    to Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Gopher Robot abandoned this change.

    View Change

    Abandoned GitHub PR golang/go#52564 has been closed.

    To view, visit change 402314. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Iaddfafbe41d58c0daffe069d718401aa574e7b8e
    Gerrit-Change-Number: 402314
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-MessageType: abandon

    Gerrit Bot (Gerrit)

    unread,
    Apr 26, 2022, 3:59:28 AM4/26/22
    to goph...@pubsubhelper.golang.org, segyo myung, golang-co...@googlegroups.com

    Gerrit Bot has uploaded this change for review.

    View Change

    reflect: change reflect.Ptr to reflect.Pointer

    Hello, this is my first PR.
    reflect.Ptr is old name of reflect.Pointer.
    So I changed it.

    Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
    GitHub-Last-Rev: 03556efb85432237302e755be5b0c1b7dfe7ab86
    GitHub-Pull-Request: golang/go#52565

    To view, visit change 402315. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
    Gerrit-Change-Number: 402315
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: segyo myung <myung...@gmail.com>
    Gerrit-MessageType: newchange

    Gopher Robot (Gerrit)

    unread,
    Apr 26, 2022, 4:05:15 AM4/26/22
    to Gerrit Bot, segyo myung, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Congratulations on opening your first change. Thank you for your contribution!

    Next steps:
    A maintainer will review your change and provide feedback. See
    https://go.dev/doc/contribute#review for more info and tips to get your
    patch through code review.

    Most changes in the Go project go through a few rounds of revision. This can be
    surprising to people new to the project. The careful, iterative review process
    is our way of helping mentor contributors and ensuring that their contributions
    have a lasting impact.

    During May-July and Nov-Jan the Go project is in a code freeze, during which
    little code gets reviewed or merged. If a reviewer responds with a comment like
    R=go1.11 or adds a tag like "wait-release", it means that this CL will be
    reviewed as part of the next development cycle. See https://go.dev/s/release
    for more details.

    View Change

      To view, visit change 402315. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
      Gerrit-Change-Number: 402315
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: segyo myung <myung...@gmail.com>
      Gerrit-Comment-Date: Tue, 26 Apr 2022 08:05:09 +0000

      Gerrit Bot (Gerrit)

      unread,
      Apr 26, 2022, 4:15:31 AM4/26/22
      to segyo myung, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Robert Griesemer, Rob Pike, Keith Randall.

      Gerrit Bot uploaded patch set #2 to this change.

      View Change

      reflect: change reflect.Ptr to reflect.Pointer

      reflect.Ptr is old name of reflect.Pointer.

      Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
      GitHub-Last-Rev: 03556efb85432237302e755be5b0c1b7dfe7ab86
      GitHub-Pull-Request: golang/go#52565
      ---
      M src/cmd/compile/internal/base/flag.go
      M src/cmd/compile/internal/ir/dump.go
      M src/cmd/compile/internal/ir/fmt.go
      M src/cmd/compile/internal/syntax/dumper.go
      M src/flag/flag.go
      5 files changed, 21 insertions(+), 8 deletions(-)

      To view, visit change 402315. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
      Gerrit-Change-Number: 402315
      Gerrit-PatchSet: 2
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Keith Randall <k...@golang.org>
      Gerrit-Reviewer: Rob Pike <r...@golang.org>
      Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Josh Bleecher Snyder <josh...@gmail.com>
      Gerrit-CC: Martin Möhrmann <moeh...@google.com>
      Gerrit-CC: Matthew Dempsky <mdem...@google.com>
      Gerrit-CC: Russ Cox <r...@golang.org>
      Gerrit-CC: segyo myung <myung...@gmail.com>
      Gerrit-Attention: Robert Griesemer <g...@golang.org>
      Gerrit-Attention: Rob Pike <r...@golang.org>
      Gerrit-Attention: Keith Randall <k...@golang.org>
      Gerrit-MessageType: newpatchset

      Gerrit Bot (Gerrit)

      unread,
      Apr 26, 2022, 4:23:28 AM4/26/22
      to segyo myung, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Robert Griesemer, Rob Pike, Keith Randall.

      Gerrit Bot uploaded patch set #3 to this change.

      View Change

      reflect: change reflect.Ptr to reflect.Pointer

      reflect.Ptr is the old name of reflect.Pointer


      Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
      GitHub-Last-Rev: 03556efb85432237302e755be5b0c1b7dfe7ab86
      GitHub-Pull-Request: golang/go#52565
      ---
      M src/cmd/compile/internal/base/flag.go
      M src/cmd/compile/internal/ir/dump.go
      M src/cmd/compile/internal/ir/fmt.go
      M src/cmd/compile/internal/syntax/dumper.go
      M src/flag/flag.go
      5 files changed, 21 insertions(+), 8 deletions(-)

      To view, visit change 402315. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
      Gerrit-Change-Number: 402315
      Gerrit-PatchSet: 3

      Keith Randall (Gerrit)

      unread,
      Apr 26, 2022, 10:54:02 AM4/26/22
      to Gerrit Bot, segyo myung, goph...@pubsubhelper.golang.org, Keith Randall, Brad Fitzpatrick, Gopher Robot, golang-co...@googlegroups.com

      Patch set 3:Run-TryBot +1Auto-Submit +1Code-Review +2

      View Change

      1 comment:

      To view, visit change 402315. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
      Gerrit-Change-Number: 402315
      Gerrit-PatchSet: 3
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Keith Randall <k...@golang.org>
      Gerrit-CC: Brad Fitzpatrick <brad...@tailscale.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: segyo myung <myung...@gmail.com>
      Gerrit-Comment-Date: Tue, 26 Apr 2022 14:53:58 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Gerrit-MessageType: comment

      Keith Randall (Gerrit)

      unread,
      Apr 26, 2022, 10:54:25 AM4/26/22
      to Gerrit Bot, segyo myung, goph...@pubsubhelper.golang.org, Keith Randall, Brad Fitzpatrick, Gopher Robot, golang-co...@googlegroups.com

      Patch set 3:Code-Review +1

      View Change

        To view, visit change 402315. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
        Gerrit-Change-Number: 402315
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@google.com>
        Gerrit-CC: Brad Fitzpatrick <brad...@tailscale.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: segyo myung <myung...@gmail.com>
        Gerrit-Comment-Date: Tue, 26 Apr 2022 14:54:20 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        Gerrit-MessageType: comment

        Keith Randall (Gerrit)

        unread,
        Apr 26, 2022, 11:07:46 AM4/26/22
        to Gerrit Bot, segyo myung, goph...@pubsubhelper.golang.org, Gopher Robot, Keith Randall, Keith Randall, Brad Fitzpatrick, golang-co...@googlegroups.com

        Patch set 3:Code-Review -1

        View Change

        1 comment:

        • Patchset:

          • Patch Set #3:

            Ah, we can't do this because it won't bootstrap with Go 1.4. We'll have to wait until we switch over to using Go 1.17 as the bootstrap.

            Which might be soon, see https://github.com/golang/go/issues/44505. We can hold on to this CL, I'll -1 it for now to prevent submission.

        To view, visit change 402315. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
        Gerrit-Change-Number: 402315
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@google.com>
        Gerrit-CC: Brad Fitzpatrick <brad...@tailscale.com>
        Gerrit-CC: segyo myung <myung...@gmail.com>
        Gerrit-Comment-Date: Tue, 26 Apr 2022 15:07:42 +0000

        Keith Randall (Gerrit)

        unread,
        Apr 26, 2022, 11:10:38 AM4/26/22
        to Gerrit Bot, segyo myung, goph...@pubsubhelper.golang.org, Gopher Robot, Keith Randall, Keith Randall, Brad Fitzpatrick, golang-co...@googlegroups.com

        View Change

        1 comment:

        • Patchset:

          • Patch Set #3:

            Ah, we can't do this because it won't bootstrap with Go 1.4. […]

            Actually, Ptr->Pointer didn't happen until 1.18, so I think we have a *long* time until we can use this CL. Sorry.

        To view, visit change 402315. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
        Gerrit-Change-Number: 402315
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@google.com>
        Gerrit-CC: Brad Fitzpatrick <brad...@tailscale.com>
        Gerrit-CC: segyo myung <myung...@gmail.com>
        Gerrit-Comment-Date: Tue, 26 Apr 2022 15:10:33 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Keith Randall <k...@golang.org>
        Gerrit-MessageType: comment

        Gopher Robot (Gerrit)

        unread,
        Feb 15, 2025, 5:56:51 AM2/15/25
        to Gerrit Bot, segyo myung, goph...@pubsubhelper.golang.org, Russ Cox, Keith Randall, Keith Randall, Brad Fitzpatrick, golang-co...@googlegroups.com

        Gopher Robot abandoned this change

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedLegacy-TryBots-Pass
        • requirement is not satisfiedNo-Holds
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: abandon
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I3a4564725d401259dd0de9477169a0b628af26f0
        Gerrit-Change-Number: 402315
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@google.com>
        Gerrit-Reviewer: Russ Cox <r...@golang.org>
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages