iota operatortype shoe int
const (
tennis shoe = iota
dress
sandal
clog
)
iota with an underscore (_ = iota)iota starts over in every new const blockfunc sum(nums ...int) int {
var total int
for _, num := range nums {
total += num
}
return total
}
s := []int{1,2,3,4}
fmt.Println(sum(s...))
append() takes a variable number of things to append to a slice, so if we do s = append(s, s...), we append s to itself, creating a list of [i for i in s, i for i in s]int in Go is nominally 64 bits on 64 bit machinesbool
string
int int8 int16 int32 int64
uint uint8 uint16 uint32 uint64 uintptr
byte // alias for uint8
rune // alias for int32
// represents a Unicode code point
float32 float64
complex64 complex128
goto statement, use with caution!