adding error management for file writer
This commit is contained in:
parent
3bc025db78
commit
8f312ce894
1 changed files with 5 additions and 2 deletions
|
@ -90,8 +90,11 @@ func saveData(word string, keysPressed []utils.InputEvent) {
|
|||
nodeBytes, err := json.Marshal(nodeDatas)
|
||||
edgeBytes, err := json.Marshal(edgeDatas)
|
||||
|
||||
ioutil.WriteFile("nodes.json", nodeBytes, 0644)
|
||||
ioutil.WriteFile("edges.json", edgeBytes, 0644)
|
||||
err = ioutil.WriteFile("nodes.json", nodeBytes, 0644)
|
||||
err = ioutil.WriteFile("edges.json", edgeBytes, 0644)
|
||||
if err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue