How to Append to a Slice in Golangby@pgaijin66

How to Append to a Slice in Golang

tldt arrow
Read on Terminal Reader🖨️

Too Long; Didn't Read

Slices in Go are not the same as slices in another programming language i.e Python. Assigning one slice to another only makes a shallow copy of the slice and should be used cautiously if you want to create a new slice from the existing slice. Go lang is easier to understand and get started with but it has its intricacies. I was working on a project and came across this behavior. I had a similar requirement where I had to manipulate slices and create new ones using Go. Thinking that it would be similar to other languages, I followed a similar approach.
featured image - How to Append to a Slice in Golang
Prabesh Thapa HackerNoon profile picture

@pgaijin66

Prabesh Thapa

Credibility

react to story with heart
Prabesh Thapa HackerNoon profile picture
by Prabesh Thapa @pgaijin66.I am SRE with software engineering experience. I love building tools to improve developer productivity.
Read My Stories

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa