Hey!
Is it possible to append to a slice/array inside a loop and keep the changes after leaving the loop?
Example:
result[][]string //filled array with entries from a database
result2[][]string //filled array with additional information for database entries
for i, entry := range result {
entry = append(entry, result2[i][1])
fmt.Println("i: ", i)
fmt.Println("entry: ", entry)
}
fmt.Println("Final result", result)
When I print the entry inside them loop, it looks like how I want it.
When I print the final result, all appended data is lost.
Beste regards
Frank