Closed jdmeyer3 closed 1 year ago
Describe the bug When a field of a struct contains a pointer to a slice, ie *[], it generates invalid dereference code.
*[]
To Reproduce
//go:generate go run github.com/jmattheis/goverter/cmd/goverter ... package converter // goverter:converter type Converter interface { ConvertHouse(source DBHouseNames) APIHouseNames } type DBHouseNames struct { Names *[]string } type APIHouseNames struct { Names *[]string }
This will end up generating code that contains invalid dereferences
... *source.Names[i]
Expected behavior it should generate code that properly dereferences the array before attempting to use the index
(*source.Names)[i]
Good catch.
Fixed in v0.11.1.
Describe the bug When a field of a struct contains a pointer to a slice, ie
*[]
, it generates invalid dereference code.To Reproduce
This will end up generating code that contains invalid dereferences
Expected behavior it should generate code that properly dereferences the array before attempting to use the index