From 73d311d1094e2b15a8a478d05c6486a9cba0f11f Mon Sep 17 00:00:00 2001 From: gutmet Date: Thu, 10 Jun 2021 23:15:54 +0200 Subject: [PATCH] close file immediately after writing --- hamilton.go | 1 + 1 file changed, 1 insertion(+) diff --git a/hamilton.go b/hamilton.go index 3e2cb78..a4147db 100644 --- a/hamilton.go +++ b/hamilton.go @@ -31,6 +31,7 @@ var step int func writeGraphfile(g [][]int, path []int) { filename := fmt.Sprintf("step%07d.dot", step) f, _ := os.Create(filename) + defer f.Close() step++ fmt.Fprintln(f, "digraph {") fmt.Fprintln(f, "dpi=200")