Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on In Go, pointers (mostly) don't go with slices in practice. Parent comment
- If you don't know where a slice came from (such as getting it passed as an argument), treat it as read-only. Any exceptions should be documented.
- If you're going to mutate a slice, make it a private member of a struct and don't give out direct access to it.
There are no comments on this comment yet.
- If you don't know where a slice came from (such as getting it passed as an argument), treat it as read-only. Any exceptions should be documented.
- If you're going to mutate a slice, make it a private member of a struct and don't give out direct access to it.