Re: [go-nuts] Re: Using underscore in return statements - a small convenience idea

2023-08-23 Thread 'Sean Liao' via golang-nuts
see also: https://go.dev/issues/19642 https://go.dev//issues/21182 - sean On Wed, Aug 23, 2023 at 3:10 PM Nick Craig-Wood wrote: > Ah ha! I thought there would be a related issue I couldn't find :-) > > `zero` would remove most of the pain though IMHO `_` looks neater in the > return

[go-nuts] Re: Using underscore in return statements - a small convenience idea

2023-08-23 Thread Nick Craig-Wood
Ah ha! I thought there would be a related issue I couldn't find :-) `zero` would remove most of the pain though IMHO `_` looks neater in the return statements! Thanks for the pointer Brian. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: Using underscore in return statements - a small convenience idea

2023-08-23 Thread Brian Candler
Something similar is in the pipeline: https://github.com/golang/go/issues/61372 When implemented, it will be spelled "zero" rather than "_" As I understand it, you'll still need to say 0, "" or nil where those are available for the type in question. Therefore in the f1() example you gave,