Browse Source

Stats file added

Loweel 4 years ago
parent
commit
1e1a48eafd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      file.go

+ 2 - 2
file.go

@@ -58,7 +58,7 @@ func saveBayesToFile() {
 
 	sJSON, serr := json.MarshalIndent(Classifier.STATS, "", " ")
 	if serr != nil {
-		sJSON = serr.Error()
+		sJSON = []byte(serr.Error())
 	}
 
 	dumpfile := os.Getenv("DUMPFILE")
@@ -70,7 +70,7 @@ func saveBayesToFile() {
 		log.Println(tmpJSON)
 	} else {
 		writeToFile(dumpfile, tmpJSON)
-		writeToFile(dumpfile+".stats", sJSON)
+		writeToFile(dumpfile+".stats", string(sJSON))
 		log.Println("File saved: ", dumpfile)
 	}