fix(fs): fix fd leaking issue
This commit is contained in:
parent
fb9de35e81
commit
50f66704b1
6 changed files with 96 additions and 39 deletions
|
@ -62,6 +62,12 @@ func compareFileContent(fs fspkg.ISimpleFS, uid, filePath string, expectedConten
|
|||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
defer func() {
|
||||
err = fs.CloseReader(filePath)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}()
|
||||
|
||||
gotContent, err := ioutil.ReadAll(reader)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue