minor enhancement: return multi error when closeAll() (#663)

Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
This commit is contained in:
Yao Zengzeng 2019-07-19 17:16:34 +08:00 committed by Krasi Georgiev
parent 7dd5e177aa
commit bff3ef3db4

View file

@ -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()
}