4 ms·
A bunch of other docs I've looked up number of times and found handy: - Slice tricks: https://github.com/golang/go/wiki/SliceTricks https://github.com/golang/g
by oxplot 5y ago
A bunch of other docs I've looked up number of times and found handy:
- Slice tricks: https://github.com/golang/go/wiki/SliceTricks https://github.com/golang/go/wiki/SliceTricks
- Rest of the Golang Github Wiki: https://github.com/golang/go/wiki#additional-go-programming-wikis https://github.com/golang/go/wiki#additional-go-programming-...
- Spec - very approachable: https://golang.org/ref/spec https://golang.org/ref/spec
- Standard library source code - clean code with lots of idioms to learn from: https://cs.opensource.google/go/go/+/refs/tags/go1.17.1:src/ https://cs.opensource.google/go/go/+/refs/tags/go1.17.1:src/
- parhamn 5y agoHopefully, a ton of the slice tricks will soon be replaced with "container/slice" (although you'll still need a few)! [1] https://github.com/golang/go/issues/45955 https://github.com/golang/go/issues/45955
- louis-paul 5y agoAlso https://github.com/golang/go/wiki/CodeReviewComments https://github.com/golang/go/wiki/CodeReviewComments
- parhamn 5y agoCool I had never seen this before. All seem on point, but I have light disagreements with this one: > The basic rule: the further from its declaration that a name is used, the more descriptive the name must be. For a method receiver, one or two letters is sufficient. Common variables such as loop indices and readers can be a single letter (i, r). More unusual things and global variables need more descriptive names. In the tighter parts of some algorithms I love seeing more descriptive variables (obvious exclusions, as noted, are things like i, j, x, y). It's very common to see double letter variable names that become hard to track (plenty in the go source as well).