Skip to content

Enum types are being duplicated in the Go code generation #595

@thiagodpf

Description

@thiagodpf

Greetings, dear maintainer!

I see you've ended your work on the project, but are you not considering even accepting a bug fix PR?

If you're willing to evaluate it, I can submit an adjustment to the method highlighted below to avoid duplicating enum types in the g.typeenums slice. It would be a short piece of code, similar to g.hasTypeDef().

avro/gen/gen.go

Lines 329 to 332 in afbafcb

func (g *Generator) resolveEnum(s *avro.EnumSchema) string {
g.typeenums = append(g.typeenums, newTypeEnum(s.Name(), s.Symbols()))
return s.Name()
}

The problem occurs when more than one Record references the same enum in its fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions