How to use the defer function in Golang to execute code at the beginning and the end of any function.