I am new to golang and trying to figure out how to deal with slices defined inside structs.
How do I dynamically populate the Slaves slice in a range loop? After a new Node instance?
type Node struct{
Index int
Slaves []string
}
Thanks
I am new to golang and trying to figure out how to deal with slices defined inside structs.
How do I dynamically populate the Slaves slice in a range loop? After a new Node instance?
type Node struct{
Index int
Slaves []string
}
Thanks
I am not sure I understand exactly what you are asking, but check out this code, and see if that answers your question:
Thanks alot Hultan! Exactly what l meant!!!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.