daily pastebin goal
11%
SHARE
TWEET

[Go] Terminating the program on error.

cwchen Oct 28th, 2017 273 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     "log"
  6.     "strconv"
  7. )
  8.  
  9. func main() {
  10.     n, err := strconv.Atoi("hello")
  11.     if err != nil {
  12.         log.Fatal(err)
  13.     }
  14.  
  15.     fmt.Println(n)
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top