Golang News http://golangnews.com Jobs, Code, Videos and News for Go hackers - everything about the go programming language Fri, 06 Sep 2019 00:35:00 +0000 Proposal: A built-in Go error check function, try #errors <p>We propose a new built-in function called <code>try</code>, designed specifically to eliminate the boilerplate <code>if</code>&nbsp;statements typically associated with error handling in Go. No other language changes are suggested. We advocate using the existing <code>defer</code>&nbsp;statement and standard library functions to help with augmenting or wrapping of errors. This minimal approach addresses most common scenarios while adding very little complexity to the language. The <code>try</code>&nbsp;built-in is easy to explain, straightforward to implement, orthogonal to other language constructs, and fully backward-compatible. It also leaves open a path to extending the mechanism, should we wish to do so in the future.</p> 12 points posted by kenny https://github.com/golang/proposal/blob/master/design/32437-try-builtin.md#proposal-a-built-in-go-error-check-function-try 3992 Wed, 05 Jun 2019 05:52:00 +0000 Typed nils for Go 2 #proposal #go2 11 points posted by daenney https://dave.cheney.net/2017/08/09/typed-nils-in-go-2 2487 Wed, 09 Aug 2017 11:31:00 +0000