close file immediately after writing
This commit is contained in:
parent
01e9a775a7
commit
73d311d109
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user