Determining the Ambiguous Golang Error
Unlike regular variable declarations, a short variable declaration can update variables if they were originally declared earlier in the same block (or a parameter list if the block is the body of a function) with the same type, and at least one of the -blank variables are new ... As a consequence, an override can only appear in a short multi-variable declaration. The Redeclaration does not introduce a new variable; it just assigns a new value to the original.
source to share
Short variable declarations are used mainly when you need to declare variables for temporary use, and these variable names can be used in further programs. For example, "err" can be used at any time in a later program. Suppose the language was java, you would have to declare more different variable names for the further program. But in golang, short variable declarations work like "let" in javascript. Hope this helps.
source to share