Logging Fatal errors
- Fatal, Fatalf, and Fataln print the message and call os.Exit(1) for the program to exit with code 1.
- Does not execute the lines after calling Fatal
examples/logging-fatal/logging_fatal.go
package main import ( "log" ) func main() { log.Print("First") log.Fatal("Oups") log.Print("Last") }
2020/04/10 08:49:41 First 2020/04/10 08:49:41 Oups exit status 1