Arrays and Slices – study, review, practice: a learning method for those needing to revisit periodically or drill Golang

What you will learn

Learn GO arrays and slices fundamentals with easy but efficient exercises.

Use these short videos as a GO language reference for reviewing or consulting.

All exercises are shown in the Golang playground. You just need access to the Internet.

GO arrays and slice techniques explained in detail as well as Go for/range loops.

Start learning GO data structures here with arrays and slice exercises. Coding is easy if properly taught.

This is the second volume in the series. Begin with volume one if you are new to Golang.

Course has been fully inspected and reviewed on September 2021.

Use this course to review your understanding of Go arrays and slices.

Description

This self contained course is the second volume of the Learning Go Programming series.
It introduces ARRAYS and SLICES with many exercises and tips.
This is a great way to review concepts after being away from programming in Go a while.

The course is designed for Go students of all levels and it stands on its own, but volume 1 is a recommended prerequisite.

Anyone taking this course should be somewhat familiar with the Golang playground, such as being aware of the main function and how to display data on screen with Println and Printf.

Here, we talk about (and work with) arrays and slices.
No other syntax theory is covered.

This is a simple tutorial and to the point, but it is not simplistic.


Get Instant Notification of New Courses on our Telegram channel.

Noteβž› Make sure your π”ππžπ¦π² cart has only this course you're going to enroll it now, Remove all other courses from the π”ππžπ¦π² cart before Enrolling!


The sessions are designed for first time learners and for periodic review if you already work with Go.

Note: This course only covers Arrays and Slices. No other data structure is discussed.
The separation of topics allow for quick review as well efficient updates when language changes occur.
After you finish doing the exercises, it will serve as a quick (efficient) resource for when you need a refresher.

A great addition to your collection of professional references.

Let’s begin!

English
language

Content

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
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 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
Please check your understanding
Go strings are slices with a fixed length
Appending a slice to another slice
Appending a slice range of values to another slice
Adding values to an empty slice
Exercise – slice of bytes
Solution – slice of bytes
Copying slices
Exercise – Copying slice of ints
Copying slices to specific target indexes
Just a personal note
Slice copying exercise
Slice copying exercise demo
Deleting an item from a slice
Exercise: Deleting two items from a slice
Result: Deleting two items from a slice
How to extend a slice using append and make
Inserting a new item in the middle of a slice
Exercise: Append two items to the middle of a slice
Answer: Append two items to the middle of a slice
Exercise: Append three items to the end of a slice
Answer: Append three items to the end of a slice
Exercise: Append an existing slice to the middle of another slice
Answer: Append an existing slice to the middle of another slice
Exercise: Append an existing slice to the middle of a modified slice
Answer: Append an existing slice to the middle of a modified slice
Appending data into mixed indexes
Exercise: Append cardinal numbers in the proper order
Answer: Append cardinal numbers in the proper order
Exercise: Appending three slices
Answer: Appending three slices
Two-dimensional arrays
RESOURCES: Go Arrays and Slices
Thank you