Closed
Description
Recently I started seeing this issue:
It happens with arrays/slices defined as a different type. You can see it happens to SomeId struct member.
type TestStruct struct {
SomeId int
}
type DataSlice []*TestStruct
func NewDataSlice() *DataSlice {
return &DataSlice{}
}
func ErrorCode() {
data := NewDataSlice()
for _, element := range data {
if element.SomeId > 20 {
println("some text")
}
}
}
Environment:
➜ ~ uname -a
Darwin domain.com 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Go: 1.5 and 1.4.2.