- Notifications
You must be signed in to change notification settings - Fork 567
Closed
Description
Hey folks. This is unresolved reference on slices, round two.
SomeId member highlighted as unresolved.
Originating bug has been fixed, however in that case object was created using NewDataSlice. This time I created a data structure in place: data := &DataSlice{} and as data := DataSlice{}
I am using 488 build of Go plugin.
type TestStruct struct { SomeId int } type DataSlice []*TestStruct func NewDataSlice() *DataSlice { return &DataSlice{} } func ErrorCode() { data := DataSlice{} for _, element := range data { if element.SomeId > 20 { println("some text") } } }
One more example:
type TestStruct struct { SomeId int } type DataSlice []*TestStruct func NewDataSlice() *DataSlice { return &DataSlice{} } func ErrorCode() { data := DataSlice{} for _, element := range *data { if element.SomeId > 20 { println("some text") } } }