this post was submitted on 18 Jun 2023
10 points (91.7% liked)

Golang

2218 readers
1 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
[–] [email protected] 4 points 1 year ago (2 children)

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.