Memory Management

Learn about memory management in Go.

We'll cover the following...

Should structs be passed by value or by reference

Arguments to Go functions are always passed by value. When a struct (or array) type variable is passed into a function, the whole struct gets copied. If a pointer to a struct gets passed, then the pointer is copied, but the struct it points to isn’t. 8 bytes ...