Commits

Cédric Bonhomme committed 41a648e

Checks if the XML file of quotes present.

Comments (0)

Files changed (1)

 // Copyright 2012 Cédric Bonhomme - http://cedricbonhomme.org/
 
 import (
-        "fmt"
         "os"
         "io/ioutil"
         "encoding/xml"
 func read(file_name string) string {
     inputFile := file_name
     buf, err := ioutil.ReadFile(inputFile)
-    if err != nil {
-        fmt.Fprintf(os.Stderr, "File Error: %s\n", err)
+    if 1 != checkError(err) {
+        return string(buf)
     }
-    return string(buf)
+    return ""
 }
 
 // Check if an error occured