Arrays & Slices
  • Why arrays?
  • What are arrays in Go?
  • Array declaration using default values
  • Declaring and assigning. Length of an array
  • Overriding index numbers when declaring arrays
  • The for loop in Go
  • The range loop in Go
  • Good news on For Range loops
  • Exercise - Print odd numbers from array values
  • Solution - Print odd numbers from array values
  • Data in arrays is passed by value
  • Passing arrays by reference
  • Passing a subset range of an array in Go
  • Array slices are pointers to array values
  • What is a slice?
  • Three ways to declare a slice
  • Appending new items to a Go slice
  • Optional quiz to check your understanding so far
  • In Go, strings are line slices, but with a fixed length
  • Appending a slice to another slice using the ellipsis (...) operator | also Copy
  • Appending a limited slice range of values to another slice
  • Adding values to an empty slice
  • Optional exercise – a slice of bytes
  • Solution – slice of bytes
  • Copying slices using the copy() function
  • Optional exercise – Copying a slice of integers
  • Copying slices to specific target indexes
  • Optional exercise on copying slices
  • Slice copying exercise demo
  • Deleting an item from a slice using append()
  • Optional exercise: Deleting two items from a slice using append()
  • Exercise result: Deleting two items from a slice using append()
  • How to extend a slice using append and make
  • Inserting a new item in the middle of a slice using 2 append()s
  • Optional exercise: Append two items to the middle of a slice using two append()s
  • Answer: Append two items to the middle of a slice
  • Optional exercise: Append three items to the end of a slice
  • Answer: Append three items to the end of a slice
  • Optional exercise: Append an existing slice to the middle of another slice
  • Answer: Append an existing slice to the middle of another slice
  • Optional exercise: Append an existing slice to the middle of a modified slice
  • Answer: Append an existing slice to the middle of a modified slice
  • Lecture: Appending data into mixed indexes
  • Optional exercise: Append cardinal numbers in the proper order
  • Answer: Append cardinal numbers in the proper order
  • Optional exercise: Appending three slices to a new slice
  • Answer: Appending three slices
  • Lecture: Two-dimensional arrays
  • RESOURCES: Go Arrays and Slices
  • Thank you