Go Lang Error Handling Issue / Misunderstanding? : <p>Ok so I am using the following code, </p>

<pre><code>err := r.ParseForm()
if err != nil {
    log.Panic(err)
}

var user User

err := decoder.Decode(&amp;user, r.PostForm)
if err != nil {
    log.Panic(err)
}
</code></pre>

<p>Now when I try to run this code, I get the following error, </p>

<pre><code>no new variables on left side of :=
</code></pre>

<p>Now I know that this is due to using the same variable, in this case <code>err</code> but I have seen lots of examples where this is how other developers deal with error handling?</p>

<p>The way that I have been using is just to use <code>err1</code> and <code>err2</code> so I can build the code.</p>

<p>I have been over the docs but there is a lot to take in and must have missed how the <code>err</code> variable is being able to be re-used, or have I completely misunderstood something? </p>

<p>Thanks, </p>
