This proposal introduces the return? keyword in Go, which allows concise early returns based on conditional assignments. It enables direct assignment to return values and a streamlined syntax for handling common error propagation patterns.
Go's error handling is explicit and encourages checking return values. However, common patterns, such as propagating errors, often lead to verbose and repetitive code. Consider the typical error-checking pattern: