Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
casualsuperman2
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
1.
▲
by
casualsuperman2
15y ago
The current weekly release has (and Go v1 will have) runtime.NumCPU() so you can do runtime.GOMAXPROCS(runtime.NumCPU())
2.
▲
by
casualsuperman2
15y ago
And then in the code for handling the error, you can do switch err.(type) { case db.IOError: // Database exception here case io.FileNotFoundError: // File exception default: // Pass it to
3.
▲
by
casualsuperman2
15y ago
In Go, the accepted way to report errors is to take advantage of multiple returns, such as: result, err := somePotentiallyFailingFunction() if err != nil { // Try to recover here ... // Not recoverable? panic
4.
▲
by
casualsuperman2
15y ago
12. I was coding JavaScript for ProBoards. I shudder just thinking about it.