title: Use of defer in Go
body: <p>What is the use of <code>defer</code> in Go? The language documentation says it is executed when the surrounding function returns. Why not just put the code at end of given function?</p>