Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sythe2o0
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
sythe2o0
11y ago
In my own experience, nil basically only shows up when I've failed to initialize something (like forgetting to loop over and make each channel in an array of channels), or when returning a nil error to indicate a function succeeded. I&
32.
▲
by
sythe2o0
11y ago
nil in Go doesn't work that way. Most types cannot be nil.
33.
▲
by
sythe2o0
11y ago
It's worth noting you'd probably want to write this out in Go as follows: names := make([]string, len(machines)) for i, m := range machines { names[i] = m.Name } append() is pretty costly, and should be avoided wh
34.
▲
by
sythe2o0
11y ago
I think they mean simple as in 'simple to write / understand'