mirror of
https://github.com/golang/go
synced 2024-12-11 15:21:00 +00:00
cb163ff60b
Fixes: #70156 Change-Id: I2e5dc2a39a8e54ec5f18c5f9d1644208cffb2e9a Reviewed-on: https://go-review.googlesource.com/c/go/+/624695 Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
24 lines
428 B
Go
24 lines
428 B
Go
// run
|
|
|
|
// Copyright 2024 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
import (
|
|
"reflect"
|
|
)
|
|
|
|
func main() {
|
|
pi := new(interface{})
|
|
v := reflect.ValueOf(pi).Elem()
|
|
if v.Kind() != reflect.Interface {
|
|
panic(0)
|
|
}
|
|
if (v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface) && v.IsNil() {
|
|
return
|
|
}
|
|
panic(1)
|
|
}
|