reflect: correct panic message

Change-Id: Ia130d9932cc67df7900285eef9ff83da440ec11e
GitHub-Last-Rev: f01e08526d
GitHub-Pull-Request: golang/go#78847
Reviewed-on: https://go-review.googlesource.com/c/go/+/768740
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
This commit is contained in:
Weixie Cui 2026-04-19 08:57:08 +00:00 committed by Gopher Robot
parent 3c770e3233
commit 3b345adf2c

View file

@ -2281,7 +2281,7 @@ func StructOf(fields []StructField) Type {
if pkgpath == "" {
pkgpath = fpkgpath
} else if pkgpath != fpkgpath {
panic("reflect.Struct: fields with different PkgPath " + pkgpath + " and " + fpkgpath)
panic("reflect.StructOf: fields with different PkgPath " + pkgpath + " and " + fpkgpath)
}
}