Gerrit Bot has uploaded this change for review.
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.
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.
Gopher Robot abandoned this change.
To view, visit change 402314. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit Bot has uploaded this change for review.
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.
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.
To view, visit change 402315. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Robert Griesemer, Rob Pike, Keith Randall.
Gerrit Bot uploaded patch set #2 to this 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.
Attention is currently required from: Robert Griesemer, Rob Pike, Keith Randall.
Gerrit Bot uploaded patch set #3 to this 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.
Patch set 3:Run-TryBot +1Auto-Submit +1Code-Review +2
1 comment:
Patchset:
Thanks.
To view, visit change 402315. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 3:Code-Review +1
Patch set 3:Code-Review -1
1 comment:
Patchset:
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.
1 comment:
Patchset:
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.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |