Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
minor enhancement: return multi error when closeAll() (#663)
Browse files Browse the repository at this point in the history
Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
  • Loading branch information
YaoZengzeng authored and krasi-georgiev committed Jul 19, 2019
1 parent 7dd5e17 commit bff3ef3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions chunks/chunks.go
Expand Up @@ -502,11 +502,11 @@ func sequenceFiles(dir string) ([]string, error) {
return res, nil
}

func closeAll(cs []io.Closer) (err error) {
func closeAll(cs []io.Closer) error {
var merr tsdb_errors.MultiError

for _, c := range cs {
if e := c.Close(); e != nil {
err = e
}
merr.Add(c.Close())
}
return err
return merr.Err()
}

0 comments on commit bff3ef3

Please sign in to comment.