# README
Overview
Pass by ?
- Go is pass by value always!
- A few types have pointer fields under the hood
- Eg.
slices
maps
channels
- Eg.
Pointers
-
p := &<variable>
var p *<type>
-
Print address using
%p
formatter -
*
is used for dereferencing as well as defining a var as pointer -
&
is used to get the address/reference of a variable -
new
builtin function can initialize memory for any type -
No pointer arithmetic
- You would have to use package
unsafe
- You would have to use package
-
unsafe
is used heavily internally
# Packages
Source: https://stackoverflow.com/questions/38001462/save-pointer-into-a-string-data-structure-in-golang.