Unverified Commit ac006c67 authored by James Bardin's avatar James Bardin Committed by GitHub
Browse files

Merge pull request #29951 from hashicorp/backport/patch-1/multiply-finer-pelican

Backport of funcs: defer close file in filesha256 into v1.1
parents 4974d307 c358c142
Showing with 2 additions and 0 deletions
+2 -0
......@@ -248,6 +248,7 @@ func makeFileHashFunction(baseDir string, hf func() hash.Hash, enc func([]byte)
if err != nil {
return cty.UnknownVal(cty.String), err
}
defer f.Close()
h := hf()
_, err = io.Copy(h, f)
......
......@@ -377,6 +377,7 @@ func readFileBytes(baseDir, path string) ([]byte, error) {
}
return nil, err
}
defer f.Close()
src, err := ioutil.ReadAll(f)
if err != nil {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment