Can someone explain why r contains two entires of the same address?
r := make([]*Result, len(m))
i := 0
for _, res := range m {
fmt.Println("index, result:", i, *&res)
r[i] = &res
i++
}
fmt.Println(r)
Results in:
index, result: 0 {[] map[0:1 1:1] {port=6379}}
index, result: 1 {[] map[0:1 1:1] {port=6380}}
[0xc21010d6c0 0xc21010d6c0]