diff options
author | Fumitoshi Ukai <fumitoshi.ukai@gmail.com> | 2015-06-02 15:51:16 +0900 |
---|---|---|
committer | Fumitoshi Ukai <fumitoshi.ukai@gmail.com> | 2015-06-02 15:51:16 +0900 |
commit | bc40a46e5c81b79e51bc23a8a539172049222568 (patch) | |
tree | eae0395916f1e1fce4a0c2a332790812c7081141 /serialize.go | |
parent | ed9a6156254afd42c2f5fd213d6f6483bee31ac4 (diff) | |
download | kati-bc40a46e5c81b79e51bc23a8a539172049222568.tar.gz |
fix readFile - fd leak
use ioutil.ReadFile instead.
exists uses os.Stat and os.IsNotExist
Diffstat (limited to 'serialize.go')
-rw-r--r-- | serialize.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/serialize.go b/serialize.go index fbf3a7c..30a4cf6 100644 --- a/serialize.go +++ b/serialize.go @@ -8,6 +8,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "net/url" "os" "sort" @@ -605,7 +606,7 @@ func LoadDepGraphCache(makefile string, roots []string) *DepGraph { return nil } } else { - c, err := readFile(mk.Filename) + c, err := ioutil.ReadFile(mk.Filename) if err != nil { LogAlways("Cache expired: %s", mk.Filename) return nil |