Update nested state Every level of nesting must by copied and updated appropriately
Mistake 1: New reference directly mutate original state
12345678
...
Documentation
Module: A module is a collection of Go package stored in a file tree with a go.mod file at its root. The go.mod file defines the module’
...
InterfacesAn interface type is defined as a set of method signatures. A value of interface type can hold any value that implements those methods.
1234
...
MethodsYou can define methods on types. A method is a function with a spetial receiver argument. The receiver appears in its own argument list between
...
RangeThe range form of the for loop iterates over a slice or map.
When ranging over a slice, two values are returned for each iteration. The first is
...
PointersGo has pointers. A pointer holds the memory address of a value.
The type *T is a pointer to a T value. Its zero value is nil
var p *int
The &a
...
Go Commandsgo fmt: format the .go files in the current directorygo fmt ./...: format everything in the current and children directory.go run <FILE_
...