awalterschulze / goderive

Derives and generates mundane golang functions that you do not want to maintain yourself
Apache License 2.0
1.23k stars 44 forks source link

`Equal` generation for anonymous structs results in a crash #80

Open jamietanna opened 1 year ago

jamietanna commented 1 year ago
package main

type ComplexStruct struct {
    Int      int
    MyStruct MyStruct
    Anon     struct {
        MyStruct MyStruct
    }
}

type MyStruct struct {
    Int64     int64
    StringPtr *string
}

func (this *ComplexStruct) Equal(that *ComplexStruct) bool {
    return deriveEqualComplexStruct(this, that)
}

Results in:

goderive
[1]    10134 killed     goderive
goderive  14.61s user 29.15s system 69% cpu 1:02.85 total

This is from:

    github.com/awalterschulze/goderive v0.0.0-20230228170144-9d8b5e1d9113
awalterschulze commented 1 year ago

Thank you for reporting