From 4589c24b54e2d647a9ecb4329bd64c09a08d139c Mon Sep 17 00:00:00 2001 From: Michael Li Date: Wed, 28 Dec 2022 12:06:44 +0800 Subject: [PATCH] fixed generate code error in Inserial* model --- internal/generator/generator.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/generator/generator.go b/internal/generator/generator.go index 05e5fd9..102f407 100644 --- a/internal/generator/generator.go +++ b/internal/generator/generator.go @@ -186,7 +186,11 @@ FuckErr: for _, iface := range ifaces { var inouts []reflect.Type for _, typ := range iface.AllInOuts() { - if err := filter.Add(typ.Name()); err == nil { + if typ.PkgPath() == iface.PkgPath { + if err := filter.Add(typ.Name()); err == nil { + inouts = append(inouts, typ) + } + } else { inouts = append(inouts, typ) } }