Skip to content

Commit

Permalink
Use value.TypeString in TypeAssertion.String
Browse files Browse the repository at this point in the history
The value.TypeString function is what the rest of the package uses
and is slightly cleaner than using reflect.Type.String.

Updates #305
  • Loading branch information
dsnet committed Jul 20, 2022
1 parent 14ad8a0 commit 7dcc7f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmp/path.go
Expand Up @@ -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 }
Expand Down

0 comments on commit 7dcc7f0

Please sign in to comment.