From 5c651bacf33e56058d4cd093fb3a07ab3bc0d75c Mon Sep 17 00:00:00 2001 From: kenshinx Date: Fri, 12 Jun 2015 12:04:23 +0800 Subject: [PATCH] Oops. Forgot close file handler. --- hosts.go | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts.go b/hosts.go index 1a1d83c..8357754 100644 --- a/hosts.go +++ b/hosts.go @@ -109,6 +109,7 @@ func (f *FileHosts) Refresh() { if err != nil { panic("Can't open " + f.file) } + defer buf.Close() scanner := bufio.NewScanner(buf) for scanner.Scan() {