Understand how to append slices in Golang



Understand how to append slices in Golang

Understand how to append slices in Golang

Every time we call an append function we are getting back a new slice. It might point to the same memory as the previous slice or it may point to a different piece of memory.

To understand how Go’s built-in append function works, let’s write our own function that emulates it’s behavior.

Append: https://golang.org/pkg/builtin/#append
More on Slices: https://www.ardanlabs.com/blog/2013/09/iterating-over-slices-in-go.html

—-

Access our online courses → https://www.ardanlabs.com/education

Attend a live training → https://www.ardanlabs.com/live-training-events/

Other Links:
Website: https://www.ardanlabs.com/
Github: https://github.com/ardanlabs
Twitter: https://twitter.com/ardanlabs

Comments are closed.