# README
Overview
Arrays
var <name> [<length>]int
len
&cap
frombuiltin
- zero values?
Slices
var <name> []int
- References to underlying array
append
- Eg.
append(s, <element1>, <element2>, ...)
- You have to assign it back to
s
or whatever is your slice variable name - Can have a different behavior depending on capacity
- Eg.
make([]<type>, len, cap)
make([]<type>, lenAndCap)
- zero value?
Intro to structs
- Store related fields of different types
struct
keyword- Usage along with
type
keyword - Anonymous structs
- Usage along with
- Struct Literal syntax
Maps
map
keywordmap[<keyType>]<valType>
make(map[string]Person)
len
onlydelete
- Eg.
delete(m, <key>)
- Eg.
- lookup returns 2 values -
val, ok
- zero value?
- They need to be initialized before usage either with
make
ormap
literal syntax:map[string]Person{}
Custom
- generics are coming in Go 2!
- Till then rely on
interface{}
or implement a DS for specific types
# Functions
No description provided by the author
# Type aliases
No description provided by the author