close file immediately after writing

This commit is contained in:
gutmet 2021-06-10 23:15:54 +02:00
parent 01e9a775a7
commit 73d311d109

View File

@ -31,6 +31,7 @@ var step int
func writeGraphfile(g [][]int, path []int) { func writeGraphfile(g [][]int, path []int) {
filename := fmt.Sprintf("step%07d.dot", step) filename := fmt.Sprintf("step%07d.dot", step)
f, _ := os.Create(filename) f, _ := os.Create(filename)
defer f.Close()
step++ step++
fmt.Fprintln(f, "digraph {") fmt.Fprintln(f, "digraph {")
fmt.Fprintln(f, "dpi=200") fmt.Fprintln(f, "dpi=200")