• glish@localghost.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    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.