Got a struct method that returns a pointer:
func (d *DataMap) Get(p Coord) *CellData {
return &d.Data[p.X+(p.Y*d.Size)]
}
The d.Data is an array of CellData which is a struct with several fields. With this method I can modify the inner value of each field, ie:
example.Get(p).Something = 123
But I cannot do something like this:
example.Get(p) = *yada (yada is a *CellData)
Where I want to replace the pointer with another pointer I get:
cannot assign to example.Get(p)(undefined)
What am I doing wrong? The output of the function is defined, dont' know why I'm getting that error. Right now I fixed this by accessing the array directly.
Thanks.