Golang log.Fatalln() function example
package log
Golang log.Fatalln() function usage example
package main
import (
"fmt"
"log"
)
func main() {
fmt.Println("Before")
value := 0.5
// Fatalf will cause the program to
// terminate
// Fatalln is kinda similar to fmt.Println (with next line)
log.Fatalln("value %f die here!", value)
fmt.Println("After")
}
Output :
Before
2015/03/26 14:34:37 value %f die here! 0.5
exit status 1
Reference :
Advertisement
Something interesting
Tutorials
+18k Golang : Get all upper case or lower case characters from string example
+17.7k Golang : Read data from config file and assign to variables
+17k Golang : Fix cannot convert buffer (type *bytes.Buffer) to type string error
+6.5k Golang : Combine slices of complex numbers and operation example
+20.6k Nginx + FastCGI + Go Setup.
+7.6k Android Studio : AlertDialog to get user attention example
+5.2k Python : Create Whois client or function example
+10.6k Golang : Bubble sort example
+11.5k Golang : Change date format to yyyy-mm-dd
+7.2k Golang : Dealing with postal or zip code example
+10.3k Golang : How to check if a website is served via HTTPS
+6.4k Golang : Break string into a slice of characters example