Articles with the tag "slices"

How to shuffle arrays and slices in Go

If you are transitioning into Go from a language like Python or Ruby, at some point or another you are going to start missing one of the many helper functions offered by the language. The most recent example of this for me was when I wanted to shuffle a slice. In Ruby this is as simple as calling the shuffle method. array = [1, 2, 3, 4, 5] array.shuffle # shuffles the array!

Why are slices sometimes altered when passed by value in Go?

In this post we discuss what causes some changes to slices to be persisted even when they are passed by value, why this ultimately happens, and how to avoid it.

How to use slice capacity and length in Go

Learn about the difference between capacity and length and how to properly utilize them to make your Go code faster, cleaner, and memory efficient.

Avatar of Jon Calhoun
Articles and Tutorials by
Jon Calhoun

Jon Calhoun is a full stack web developer who teaches about Go, web development, algorithms, and anything programming. If you haven't already, you should totally check out his Go courses.

Previously, Jon worked at several statups including co-founding EasyPost, a shipping API used by several fortune 500 companies. Prior to that Jon worked at Google, competed at world finals in programming competitions, and has been programming since he was a child.

Recent Articles All Articles Mini-Series Progress Updates Tags About Me Go Courses

©2018 Jonathan Calhoun. All rights reserved.