Commits

Miki Tebeka committed 6fdbe5f

recover

Comments (0)

Files changed (1)

 var lineNums = flag.Bool("n", false, "number lines")
 
 func main() {
+	defer func() {
+		if err := recover(); err != nil {
+			fmt.Fprintf(os.Stderr, "%s\n", err)
+			os.Exit(1)
+		}
+	}()
+
 	flag.Parse()
 
 	var files []string
 		files = flag.Args()
 	}
 
-	fmt.Println(files)
-
 	lnum := uint64(0)
 	for _, filename := range(files) {
 		file := open(filename)