News for hackers. Stuff that matters.
Re:The ecosystem of the Go programming language by mweibel on Monday March 22, 2021 @10:08AM (#26540968)
you could use an `else` clause for the scope:

  if foo, err := doThing(bar); err != nil {
    // handle error  
  } else {
    // handle foo
  }
but most don't use that form and just do the call outside:

  foo, err := doThing(bar)
  if err != nil {
    // handle error  
  }
Re:The ecosystem of the Go programming language by cratermoon on Monday March 22, 2021 @11:05AM (#26541863)
or pass doThing as a function parameter

https://play.golang.org/p/4PoK6EZc4W9