Defer Keyword in Golang In Go, defer statements delay execution of a function or method or an anonymous method until the nearby functions return.