Notes on 'Go in action' book
Slice takes 24 bit of memory — 8 bit for pointer, 8 for len and 8 for capacity. Passing a slice between functions is okay, since it is copied BUT in the copied version we still have the correct pointer. Reference types in Go: string slice map channel interface function The decision to use value or pointer receiver should not be based on whether method is mutating given value or not. Decision should be based on a nature of a given type. e.g. time is always a copy, you can’t really change time. A File can be changed so it should be passed as a reference. See how it is implemented in core library. ...