diff --git a/tools/exp/props/pkg.go b/tools/exp/props/pkg.go index 551dd1a..40548f0 100644 --- a/tools/exp/props/pkg.go +++ b/tools/exp/props/pkg.go @@ -117,12 +117,17 @@ func (t *TypePackageGenerator) PublicDefinitions(tgs []*TypeGenerator) *codegen. // Precondition: The passed-in generators are the complete set of type // generators within a package. func (t *TypePackageGenerator) PrivateDefinitions(tgs []*TypeGenerator) (*jen.Statement, *codegen.Interface, *codegen.Function) { - var fns []codegen.FunctionSignature + fnsMap := make(map[string]codegen.FunctionSignature) for _, tg := range tgs { for _, m := range tg.getAllManagerMethods() { - fns = append(fns, m.ToFunctionSignature()) + v := m.ToFunctionSignature() + fnsMap[v.Name] = v } } + var fns []codegen.FunctionSignature + for _, v := range fnsMap { + fns = append(fns, v) + } return jen.Var().Id(managerInitName()).Id(managerInterfaceName), codegen.NewInterface(tgs[0].PrivatePackage().Path(), managerInterfaceName,