Codegen: fix jenny_eachmajor.go (#64287)

Update jenny_eachmajor.go
This commit is contained in:
Agnès Toulet 2023-03-09 18:24:03 +01:00 committed by GitHub
parent 4d0e309d4e
commit f9b5dbb473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,13 @@ func (j *lmox) Generate(kind kindsys.Kind) (codejen.Files, error) {
}
var fl codejen.Files
major := -1
for sch := kind.Lineage().First(); sch != nil; sch = sch.Successor() {
if int(sch.Version()[0]) == major {
continue
}
major = int(sch.Version()[0])
sfg.Schema = sch.LatestInMajor()
files, err := do(sfg, fmt.Sprintf("v%v", sch.Version()[0]))
if err != nil {