From 7dcc7f03dc915abcc86ce2549d23d4d9b4eea3cc Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Wed, 20 Jul 2022 11:33:49 -0700 Subject: [PATCH] Use value.TypeString in TypeAssertion.String The value.TypeString function is what the rest of the package uses and is slightly cleaner than using reflect.Type.String. Updates #305 --- cmp/path.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmp/path.go b/cmp/path.go index 557c7f2..185efaa 100644 --- a/cmp/path.go +++ b/cmp/path.go @@ -284,7 +284,7 @@ type typeAssertion struct { func (ta TypeAssertion) Type() reflect.Type { return ta.typ } func (ta TypeAssertion) Values() (vx, vy reflect.Value) { return ta.vx, ta.vy } -func (ta TypeAssertion) String() string { return fmt.Sprintf(".(%v)", ta.typ) } +func (ta TypeAssertion) String() string { return fmt.Sprintf(".(%v)", value.TypeString(ta.typ, false)) } // Transform is a transformation from the parent type to the current type. type Transform struct{ *transform }