this post was submitted on 18 Jun 2023
5 points (85.7% liked)

Golang

2201 readers
11 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] glish@localghost.org 4 points 1 year ago

Go is exclusively pass-by-value. That means each function receives a copy of the value of what you passed in. No exceptions.

Except there are several exceptions... Maps are always pass by reference, even if you don't explicitly pass them as a pointer. Same with slices, channels, and interfaces. Good article otherwise though.