deferis special keyword in Go to schedule some action until function returns. Defer is mostly used in cleanup task that should be done when returning from a function. Defer find its use similar to what finally does in some programming languages. Semantic for defer is
deferkeyword is that Go guarantees it will be carried out even if there is panic.