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
+11.3k Golang : Fix fmt.Scanf() on Windows will scan input twice problem
+9.4k Golang : Web(Javascript) to server-side websocket example
+21.8k Golang : Convert string slice to struct and access with reflect example
+13.9k Golang : Human readable time elapsed format such as 5 days ago
+7.1k Golang : Gorrila mux.Vars() function example
+5k Golang : Calculate a pip value and distance to target profit example
+80.6k Golang : How to return HTTP status code?
+5.2k PHP : See installed compiled-in-modules
+21.8k Golang : How to reverse slice or array elements order
+9.1k Golang : Intercept and compare HTTP response code example
+14.8k Golang : Get URI segments by number and assign as variable example
+7.3k Golang : Not able to grep log.Println() output