Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, like I said, I've never seen anyone claim Go as pass-by-reference. That having been said, the spec refers to slices and maps as "reference types" but it doesn't mean they're pass by reference. They're still passed as a pointer, you just don't see it.

You're correct about the "ref" keyword in C#, when used for the arg and parameter, it causes the function or method to act on the same chuck of memory as the alias represented in the caller.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: