For day3 I decided I would need a data structure and functions that operated on said persistent data structure. In Python and C++ these would be classes. Go does not have classes. It has structs and functions that operate on structs, called methods. This reminded me of Lisp.

If you want to mutate the receiver (the struct/type on which you design the method to be applied) you have to make the receiver a pointer type. This should remind people of the this keyword in C++ (back in the days when you needed this)

Of note. “You can only declare a method with a receiver whose type is defined in the same package as the method. You cannot declare a method with a receiver whose type is defined in another package (which includes the built-in types such as int).”

For now I don’t see why things have to be done this way. I read about interfaces but won’t really understand their advantage until I start using them in earnest.