Ensure that we are closing files.

This commit is contained in:
Piotr Skamruk
2016-09-06 09:58:22 +02:00
parent ff1cec99cc
commit dc3674c8d0
5 changed files with 6 additions and 0 deletions

View File

@@ -156,6 +156,7 @@ func readInstanceID() (string, error) {
if err != nil {
return "", fmt.Errorf("Cannot open %s: %v", metaDataPath, err)
}
defer file.Close()
return parseMetaData(file)
}