The following lines correspond to the output of lines 79-82. I just get an infinite loop instead. I presume that node
elements first child node.FirstChild
's parent ie node.FirstChild.Parent
would be node
itself rather than node.Parent
.
Since the heirarchy is div.color_picker
> div.over_wrap
.
Its probably some Golang concept that I've over looked or something silly that I can't seem to notice. What am I doing wrong?
####Expected result
actual parent
&{0xc0820347e0 0xc082034930 0xc082034a10 0xc082034850 0xc082034a80 3 div div [{
class over_wrap} { data-cc 0}]}
child's parent
&{0xc0820347e0 0xc082034930 0xc082034a10 0xc082034850 0xc082034a80 3 div div [{
class over_wrap} { data-cc 0}]}
####Actual Result
actual parent
&{0xc0820347e0 0xc082034930 0xc082034a10 0xc082034850 0xc082034a80 3 div div [{
class over_wrap} { data-cc 0}]}
child's parent
&{0xc082034460 0xc082034850 0xc082034a80 0xc082034770 0xc082034af0 3 div div [{
class color_picker}]}
Silly silly me... https://gist.github.com/shyamsalimkumar/9f62dbe94b3e6f8186cf69aa7a4faf60#file-test-go-L78 is supposed to be
for child := node.FirstChild; child != nil; child = child.NextSibling {
. Thanks to the nice folks at #go-nuts