-
Structs and primitive types in Go can be either pointers or values. In many other languages, primitive types are always values and classes are always pointers.
-
Use new to make a pointer out of a constant or literal value, or to make a non-nil pointer to an instance of a type.
-
When a variable is passed to new, it makes a pointer to a shallow copy of the variable. Pointer fields in the copy still alias the original’s data. Use & when you mean to reference the original, not duplicate it.
Progress is saved on this device.