If it were a keyword rather than a pseudo-function, I would support its addition. Psuedo-functions should not be allowed into the language, as they tend to have side effects that you wouldn't expect from a function call (such as returning from caller to grandparent).<p>Some keyword that implies "return if error" so that you could then do:<p><pre><code> try v1, v2, v3 := someFunction()
</code></pre>
You could even make it a little bit smart, taking advantage of the return types of the function to automatically fill in named return values:<p><pre><code> func MyFunc(param int) (result int, err error) {
result = 0
if param > 0 {
result = param + 10
} else {
try p1, p2 := GetInternalValues(param)
result = p1 * p2
}
return result, err
}
</code></pre>
where "try p1, p2 := GetInternalValues(param)" is syntactic sugar for (in this case):<p><pre><code> var p1, p2 int
p1, p2, err = GetInternalValues(param)
if err != nil {
return result, err
}</code></pre>