Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 273 Bytes

exit.md

File metadata and controls

15 lines (12 loc) · 273 Bytes

The defer statement will not be executed, since os.Exit will abruptly exit the program. This is common mistake when you want to perform graceful shutdown.

package main

import (
	"fmt"
	"os"
)

func main() {
	defer fmt.Println("Hello, playground")
	os.Exit(0)
}