schema/field: use reflect string for rtype identifier

This commit is contained in:
Ariel Mashraki
2021-04-26 16:48:29 +03:00
committed by Ariel Mashraki
parent b20d521593
commit 9b73ca3eef
2 changed files with 6 additions and 5 deletions

View File

@@ -6,7 +6,6 @@ package field
import (
"fmt"
"path"
"reflect"
"strings"
)
@@ -187,7 +186,8 @@ var (
// RType holds a serializable reflect.Type information of
// Go object. Used by the entc package.
type RType struct {
Name string
Name string // reflect.Type.Name
Ident string // reflect.Type.String
Kind reflect.Kind
PkgPath string
Methods map[string]struct{ In, Out []*RType }
@@ -206,7 +206,7 @@ func (r *RType) String() string {
if r.rtype != nil {
return r.rtype.String()
}
return path.Base(r.PkgPath) + "." + r.Name
return r.Ident
}
// IsPtr reports if the reflect-type is a pointer type.