Open
Description
Consider following declared types, as found in the github.com/golang/geo/s2 package:
package s2
type CellID uint64
type CellUnion []CellID
This package is then used in another file as follows:
type Filter struct {
Cells *s2.CellUnion `json:"cells"`
}
Running ffjson for this file produces the following code, and no error messages:
j.Cells = &[]s2.CellID{}
However, this produces the following error when building:
cannot use []s2.CellID literal (type *[]s2.CellID) as type *s2.CellUnion in assignment
The correct code in this case would be
cu := s2.CellUnion([]s2.CellID{})
j.Cells = &cu
Metadata
Metadata
Assignees
Labels
No labels