api: let Identify return multiple identities (#32949)
This commit is contained in:
parent
0ae85295dc
commit
0be2e0d803
51 changed files with 318 additions and 200 deletions
|
|
@ -38,6 +38,10 @@ type typeStruct struct {
|
|||
|
||||
func getTypeImport(t reflect.Type) string {
|
||||
n := t.Name()
|
||||
if n == "" {
|
||||
// unnamed type, e.g. []string
|
||||
return t.String()
|
||||
}
|
||||
if p := t.PkgPath(); p != "" {
|
||||
if s := strings.Split(p, "github.com/evcc-io/evcc/"); len(s) == 2 {
|
||||
return fmt.Sprintf("%s.%s", s[1], n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue