The Go Language: Arrays & Slices

Learn, Practice, Review - Your second volume in your Go basic syntax adventure
Free tutorial
Rating: 4.8 out of 5 (30 ratings)
748 students
1hr 40min of on-demand video
English [Auto]

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.


  • This is an intermediate Go study course. Prior exposure to variables and basic functions is helpful.
  • This is the second volume of a series but it is self-contained.
  • The project is designed for both learning or reviewing. Videos are self-contained.


This is the second volume of the GO Language series  by Tony de Araujo. It contains around two hours of videos and exercises designed to make you proficient on Go array and slice structures.

Rather than being a primer, it is a didactic sequential approach with short explanations and exercises. By the end of this tutorial series, you’ll have a solid understanding of arrays and slices in Go, enabling you to choose the right data structure for your specific use case.

Understanding Arrays and Slices in Go

In Go, arrays and slices are essential data structures that allow you to work with ordered sequences of elements.
These collections are particularly useful when dealing with related values.

Here’s a breakdown of the key differences between arrays and slices:


  • In Go an array is a fixed-size data structure.

  • Its capacity is defined at creation time and cannot be changed afterward.

  • Once you allocate an array’s size, it remains constant.

  • Arrays are suitable when you know the exact number of elements you need.\Example: var myArray [5]int creates an integer array with 5 elements.


  • A slice is a dynamically resizable data structure.

  • Unlike arrays, slices can grow or shrink as needed.

  • Slices are built on top of arrays and provide a more flexible way to work with sequences.

  • They are commonly used when the number of elements is not fixed.

  • Example: mySlice := []int{1, 2, 3} creates an integer slice.

Why Use Arrays and Slices?

  • Data Organization: Arrays and slices allow you to group related data together. For instance, you can store a list of temperatures, user IDs, or product prices.

  • Code Efficiency: By using arrays and slices, you can perform the same operations on multiple values simultaneously. This leads to cleaner and more concise code.

  • Flexibility: Slices adapt to your needs, making them ideal for scenarios where the size may change dynamically.

Tutorial Series Contents:

1. Introduction: Understand the basics of arrays and slices.

2. Declaration and Initialization: Learn how to declare and initialize arrays and slices.

3. Accessing Elements: Explore methods to access individual elements.

4. Modifying Elements: Discover how to modify array and slice elements.

5. Iterating Over Arrays and Slices: Master loops and range-based iteration.

6. Multidimensional Arrays: Dive into arrays with multiple dimensions.

7. Built-in Functions: Explore useful functions for working with arrays and slices.

By the end of this tutorial series, you’ll have a solid understanding of arrays and slices in Go, enabling you to choose the right data structure for your specific use case.

Who this course is for:

  • Go language students wanting to understand arrays and slices
  • Go programmers who want to refresh syntax and concepts


Tech Writer - Published Author on Programming [Amazon]
Tony de Araujo
  • 4.8 Instructor Rating
  • 156 Reviews
  • 1,898 Students
  • 4 Courses

Hello, and welcome!

As a seasoned corporate technical instructor with over four decades of teaching experience, I’ve had the privilege of training professionals in person across the United States and abroad. My passion for sharing knowledge drives me to empower students, fostering their growth and success, while constantly rethinking how to teach.

My purpose on Udemy is to create concise and impactful tutorials that cater to both beginners and those looking to refresh their coding syntax skills, even in the era of AI, which I'm carefully beginning to address in some of the exercises. Instead of merely typing out code, programmers will increasingly emphasize problem-solving and designing smart solutions.

For that, however, we must understand  syntax the same way we would comprehend math while using a calculator as a tool.  This is where my efforts reside: to provide clear and succinct explanations of the Go language.

Here’s what you can expect from my courses on Go syntax, some morphology, and Go semantics:

1. Short and Focused: I believe in brevity without sacrificing depth. My tutorials get straight to the point, ensuring you learn efficiently, but also return to review later.

2. Affordable Learning: Some of my courses are free to enroll, while others come at a modest charge. Your support helps me to continue creating valuable content.

---- // ----

Beyond teaching, I wear several hats:

Programmer: I love diving into code, solving problems, and building practical applications. I'm also enjoying querying AI for possible solutions while still keeping my skills refreshed.

Technical Writer: Communicating complex concepts in a clear and accessible manner is my forte. Now, I'm also begging to modestly use artificial intelligence as my go to editor of choice to spot possible problems in my messages.

Former Corporate Executive: I’ve navigated the corporate world, gaining insights that enrich my teaching.

Musician: When I’m not coding, you’ll find me strumming my guitar or tinkering with musical compositions.

Proud Grandfather: Being a grandparent is my best job ever. The joy of sharing stories, teaching solfege, laughter, and life lessons with my grandchildren is immeasurable.

-- Join me on this learning journey, and let’s explore the fascinating world of technology together!

Tips on how to approach and study Go programming in these series

Each of the Go language tutorial-and-review series is self-contained.
However, if you're new to the Go language, please enroll in the following sequence of courses to assure your best understanding of the subject:

Volume 1 = The Go Language: Your First Code Adventure. Don't skip this volume as it contains important concepts.

Volume 2 = The Go Language: Arrays & Slices. This is essential to understand the 3rd volume that follows. It is currently open for free enrolment.

Volume 3 = The Go Language: Maps, Interfaces, and More.

(A possible 4th volume is in the works).

Top companies trust Udemy

Get your team access to Udemy's top 25,000+ courses