Logging Fatal errors
Fatal
,Fatalf
, andFataln
print the message and callos.Exit(1)
for the program to exit with code 1.- Does not execute the lines after calling
Fatal
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