Your solution fixes the error, but at the cost of losing the upside OP saw.
let {
var err := error scoped code }
{ var err error scoped code }