https://golang.org/issue/38151   great news !... lets hope something 
finally gets resolved
FWIW, I modify my original proposal: replacing   #{.. .}  with   err {...}  
 

On Sunday, June 14, 2020 at 12:57:01 PM UTC-4, Ian Lance Taylor wrote:
>
> On Sun, Jun 14, 2020 at 8:25 AM Tom Limoncelli <t...@whatexit.org 
> <javascript:>> wrote: 
> > 
> > On Thu, Jun 4, 2020 at 3:34 PM Ian Lance Taylor <ia...@golang.org 
> <javascript:>> wrote: 
> > > 
> > > On Thu, Jun 4, 2020 at 8:43 AM <lgo...@gmail.com <javascript:>> 
> wrote: 
> > > > 
> > > > ?? Why not a cleaner syntax e.g.  x = some_func ()  #{ }   .. symbol 
> # arbitrarily chosen 
> > > 
> > > Besides what other people have said, it may be of interest to glance 
> > > through 
> https://github.com/golang/go/issues?q=is%3Aissue+label%3Aerror-handling 
> > 
> > I assert that 80% of the annoyance that people feel is the number of 
> > lines required to handle errors, not the syntax.  Thus, a large 
> > segment of the community would stop caring about this if we modified 
> > gofmt, not the go language.  Specifically, gofmt would simply format 
> > short if's on one lie when possible. 
> > 
> > OLD: 
> > 
> > a, err := ioutil.ReadFile(patha) 
> > if err != nil { 
> >       return err 
> > } 
> > b, err := ioutil.ReadFile(pathb) 
> > if err != nil { 
> >       return err 
> > } 
> > c, err := ioutil.ReadFile(pathc) 
> > if err != nil { 
> >       return fmt.Errorf("wrapped %v: %w", pathc, err) 
> > } 
> > 
> > NEW: 
> > 
> >   a, err := ioutil.ReadFile(patha) 
> >   if err != nil { return err } 
> >   b, err := ioutil.ReadFile(pathb) 
> >   if err != nil { return err } 
> >   c, err := ioutil.ReadFile(pathc) 
> >   if err != nil { return fmt.Errorf("wrapped %v: %w", pathc, err) } 
> > 
> > This is half as many lines, thus makes it easier to fit on one 
> > screenful of an editor, which is often a cognitive limit for a 
> > developer. 
> > 
> > I'm not saying that this solves the problem, but I bet it would reduce 
> > the pressure to fix it. 
>
>
>
> https://golang.org/issue/38151 
>
> Ian 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f5812941-1a70-4613-a87b-363c7aef9b0eo%40googlegroups.com.

Reply via email to