O'Reilly logo
  • Jose E Colon Rodriguez thinks this is interesting:

A short variable declaration acts like an assignment only to variables that were already declared in the same lexical block; declarations in an outer block are ignored


Cover of The Go Programming Language


So if you have err from an outer block, := will re-declare it in the current scope.