Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
Signed-off-by: Alba Hita Catala <ahitacat@redhat.com>
  • Loading branch information
ahitacat committed Dec 18, 2024
1 parent 07233bc commit dc4962c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
11 changes: 0 additions & 11 deletions pkg/generators/golang/json_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,6 @@ func (g *JSONSupportGenerator) Run() error {
}
for _, typ := range version.Types() {
for _, att := range typ.Attributes() {
// if att.Type().Owner().Name() != version.Name() ||
// (att.Type().IsList() && att.Type().Element().Owner().Name() != version.Name()) {
// importRefs = append(importRefs,
// struct {
// path string
// selector string
// }{
// path: g.packages.VersionImport(att.Type().Owner()),
// selector: g.packages.VersionSelector(att.Type().Owner()),
// })
// }
if att.LinkOwner() != nil {
importRefs = append(importRefs,
struct {
Expand Down
7 changes: 0 additions & 7 deletions pkg/generators/golang/types_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,3 @@ func (g *TypesGenerator) listName(typ *concepts.Type) string {
}
return typeName + "List"
}

func (g *TypesGenerator) versionSelector(attribute *concepts.Attribute) string {
if attribute.LinkOwner() == nil {
return ""
}
return fmt.Sprintf("*%s.", g.packages.VersionSelector(attribute.LinkOwner()))
}
19 changes: 2 additions & 17 deletions pkg/language/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,23 +487,8 @@ func (r *Reader) recursivelyAddTypeToVersion(currType *concepts.Type,
}
for _, attribute := range referencedType.Attributes() {
if attribute.Link() {
// We need to check if the type was previously introduced
// in that case we would simply changes the owner of the attribue
// as we had already compiled it in this version.
// if attribute.Type().IsList() {
// if r.version.FindType(attribute.Type().Element().Name()) == nil {
// r.version.AddTypeWithoutOwner(attribute.Type())
// r.version.AddTypeWithoutOwner(attribute.Type().Element())
// } else {
// elementOwner := r.version.FindType(attribute.Type().Element().Name()).Owner()
// if attribute.Type().Owner() != elementOwner {
// attribute.Type().SetOwner(elementOwner)
// attribute.Type().Element().SetOwner(elementOwner)
// }
// }
// } else if r.version.FindType(attribute.Type().Name()) == nil {
// r.version.AddTypeWithoutOwner(attribute.Type())
// }
// If the attribute is a Link set the LinkOwner
// to the attribute type Owner
attribute.SetLinkOwner(attribute.Type().Owner())
} else if attribute.Type().IsList() || attribute.Type().IsMap() {
r.version.AddType(attribute.Type())
Expand Down

0 comments on commit dc4962c

Please sign in to comment.