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
fmt.Println("primes[1:4] ==", primes[1:4]) zeroes := make([]int, 5) fmt.Println("zeroes ==", zeroes) for i, v := range primes { fmt.Prine("(%d) = %d\n", i, v) } for _, v := range primes { fmt.Prine("%d\n", v) }
defer close(c) for { work := getWork() c <-‐ work } } func consumer(c chan string) { for msg := range c { process(msg) } } func ProducerConsumer() { c := make(chan string) go producer(c) consumer(c) }