c(); // ← ここはスキップされて } catch (e) { // ← いきなりここに飛んでくる } finally { // ← さらにここも通る } We believe that coupling exceptions to a control structure, as in the try-catch-finally idiom, results in convoluted code. https://go.dev/doc/faq#exceptions 6
{ //return err ← before return fmt.Errorf("invalid integer: %q", a)// ← after } 他の言語から来た直後は冗長に感じるが、Goに慣れると気にならなくなる Many mentioned that the lack of specific error handling support in Go is most apparent when coming freshly from another language that has that support. As one becomes more fluent and writes more idiomatic Go code, the issue becomes much less important. https://go.dev/blog/error-syntax#:~:text=On a final,another data point. 11