Make manager interface for type packages have unique methods
このコミットが含まれているのは:
コミット
73d677460b
|
@ -117,12 +117,17 @@ func (t *TypePackageGenerator) PublicDefinitions(tgs []*TypeGenerator) *codegen.
|
||||||
// Precondition: The passed-in generators are the complete set of type
|
// Precondition: The passed-in generators are the complete set of type
|
||||||
// generators within a package.
|
// generators within a package.
|
||||||
func (t *TypePackageGenerator) PrivateDefinitions(tgs []*TypeGenerator) (*jen.Statement, *codegen.Interface, *codegen.Function) {
|
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 _, tg := range tgs {
|
||||||
for _, m := range tg.getAllManagerMethods() {
|
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),
|
return jen.Var().Id(managerInitName()).Id(managerInterfaceName),
|
||||||
codegen.NewInterface(tgs[0].PrivatePackage().Path(),
|
codegen.NewInterface(tgs[0].PrivatePackage().Path(),
|
||||||
managerInterfaceName,
|
managerInterfaceName,
|
||||||
|
|
読み込み中…
新しいイシューから参照