mirror of
https://gitea.com/gitea/go-fed-activity.git
synced 2024-06-01 17:51:23 +05:30
Address two TODOs
This commit is contained in:
parent
f2c70191ab
commit
a4f90ff8e0
|
@ -216,6 +216,7 @@ func (m *ManagerGenerator) createDeserializationMethod(deserName string, pubPkg,
|
|||
jen.Error(),
|
||||
).Block(
|
||||
jen.List(
|
||||
// Note: this "i" must be the same as the "i" in the deserialization definition.
|
||||
jen.Id("i"),
|
||||
jen.Err(),
|
||||
).Op(":=").Qual(privPkg.Path(), deserName).Call(jen.Id("m")),
|
||||
|
|
|
@ -77,21 +77,9 @@ func (p *NonFunctionalPropertyGenerator) Definitions() (*codegen.Struct, *codege
|
|||
return p.cachedStruct, p.cachedTypedef
|
||||
}
|
||||
|
||||
// iteratorTypeName determines the identifier to use for the iterator type.
|
||||
func (p *NonFunctionalPropertyGenerator) iteratorTypeName() Identifier {
|
||||
return Identifier{
|
||||
LowerName: p.Name.LowerName,
|
||||
CamelName: fmt.Sprintf("%sPropertyIterator", p.Name.CamelName),
|
||||
}
|
||||
}
|
||||
|
||||
// iteratorInterfaceName gets the interface name for the iterator.
|
||||
//
|
||||
// TODO: Fix this kluge, which must be kept in sync with
|
||||
// PropertyGenerator.InterfaceName().
|
||||
func (p *NonFunctionalPropertyGenerator) iteratorInterfaceName() string {
|
||||
id := p.iteratorTypeName()
|
||||
return fmt.Sprintf("%sInterface", id.CamelName)
|
||||
return fmt.Sprintf("%sInterface", p.iteratorTypeName().CamelName)
|
||||
}
|
||||
|
||||
// elementTypeGenerator produces a FunctionalPropertyGenerator for the iterator
|
||||
|
|
|
@ -192,6 +192,14 @@ func (p *PropertyGenerator) StructName() string {
|
|||
return fmt.Sprintf("%sProperty", p.Name.CamelName)
|
||||
}
|
||||
|
||||
// iteratorTypeName determines the identifier to use for the iterator type.
|
||||
func (p *PropertyGenerator) iteratorTypeName() Identifier {
|
||||
return Identifier{
|
||||
LowerName: p.Name.LowerName,
|
||||
CamelName: fmt.Sprintf("%sPropertyIterator", p.Name.CamelName),
|
||||
}
|
||||
}
|
||||
|
||||
// InterfaceName returns the interface name of the property type.
|
||||
func (p *PropertyGenerator) InterfaceName() string {
|
||||
return fmt.Sprintf("%sInterface", p.StructName())
|
||||
|
|
|
@ -130,8 +130,6 @@ func NewTypeGenerator(vocabName string, pm *PackageManager, typeName, comment st
|
|||
func (t *TypeGenerator) apply(m *ManagerGenerator) error {
|
||||
t.m = m
|
||||
// Set up Kind functions
|
||||
// Note: this "i" must be the same as the "i" in the deserialization definition.
|
||||
// TODO: Remove this kluge. (2nd todo: figure out wtf this todo means)
|
||||
deser := m.getDeserializationMethodForType(t)
|
||||
kind := jen.Qual(t.PublicPackage().Path(), t.InterfaceName())
|
||||
for _, p := range t.rangeProperties {
|
||||
|
|
Loading…
Reference in a new issue