I\'m trying to understand why the following test code is not working as expected:
package main import ( \"fmt\" \"strings\" ) type Test struct {
Go is going to pass everything by value. That includes function parameters, return values and when iterating over a slice, map or channel.
to add to @noj's answer if you switch your receiver to *Test type go will use a pointer automatically.