Fixes #46107
Change-Id: I170f3cacda652752cd740e04b565a616a0e43fd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/632635
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
return
}
v := reflect.ValueOf(n)
- if v.Type().Kind() != reflect.Pointer {
+ if v.Kind() != reflect.Pointer {
return
}
if v.IsNil() {
return
}
v = v.Elem()
- if v.Type().Kind() != reflect.Struct {
+ if v.Kind() != reflect.Struct {
return
}
for i := 0; i < v.NumField(); i++ {
value := reflect.ValueOf(e)
// If e represents a value as opposed to a pointer, the answer won't
// get back to the caller. Make sure it's a pointer.
- if value.Type().Kind() != reflect.Pointer {
+ if value.Kind() != reflect.Pointer {
dec.err = errors.New("gob: attempt to decode into a non-pointer")
return dec.err
}
for i := 0; i < indir; i++ {
value = reflect.Indirect(value)
}
- if ut.externalEnc == 0 && value.Type().Kind() == reflect.Struct {
+ if ut.externalEnc == 0 && value.Kind() == reflect.Struct {
enc.encodeStruct(b, engine, value)
} else {
enc.encodeSingle(b, engine, value)
}
}
- if val.Type().Kind() == reflect.Slice && val.Type().Elem().Kind() != reflect.Uint8 {
+ if val.Kind() == reflect.Slice && val.Type().Elem().Kind() != reflect.Uint8 {
// Slice of element values.
// Grow slice.
n := val.Len()