3 ms·
Goto's are used extensively in the Linux kernel for clean exits from functions (typically system calls) that must validate parameters, allocating resources as t
by scott_s 12y ago
Goto's are used extensively in the Linux kernel for clean exits from functions (typically system calls) that must validate parameters, allocating resources as they go, but then abort if there are any errors in the parameters. For example: http://lxr.free-electrons.com/source/kernel/fork.c?v=3.3#L427 http://lxr.free-electrons.com/source/kernel/fork.c?v=3.3#L42...
- nulltype 12y agoIn Go, defer basically serves this use case.