I’m trying to come up with a way to sort HTML table data into some sort or array or map so that I can do something along with lines of:
package main
import “fmt”
func main() {
rows := make(map[string]string)
row := string{“this”,“is”,“a”,“row”}
rows[“test”] = row[:]
row = row[:0]
row = append(row,“another”)
row = append(row,“test”)
row = append(row,“of”)
row = append(row,“rows”)
rows[“another”] = row[:]
fmt.Println(rows)
}
The problem is that it appears to be copying a reference to row rather then the values so when I run this I end up getting:
map[another:[another test of rows] test:[another test of rows]]
How do I copy the actual contents?
Thanks,
Rob