From 4b9fbd3b3a34843a8ad025d86410b21540c37e51 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 22 Mar 2015 14:51:18 -0700 Subject: [PATCH] DonutfileWriter should return value of file.Close() --- pkg/storage/donut/donutdriver.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/storage/donut/donutdriver.go b/pkg/storage/donut/donutdriver.go index 14ec2082c..b387fe2ae 100644 --- a/pkg/storage/donut/donutdriver.go +++ b/pkg/storage/donut/donutdriver.go @@ -327,23 +327,19 @@ func (d donutFileWriter) Close() error { if d.err != nil { return d.err } - - d.file.Close() - metadata, _ := json.Marshal(d.metadata) ioutil.WriteFile(path.Join(d.root, "metadata.json"), metadata, 0600) donutMetadata, _ := json.Marshal(d.donutMetadata) ioutil.WriteFile(path.Join(d.root, "donutMetadata.json"), donutMetadata, 0600) - return nil + return d.file.Close() } func (d donutFileWriter) CloseWithError(err error) error { if d.err != nil { d.err = err } - d.file.Close() - return nil + return d.Close() } func (d donutFileWriter) SetMetadata(metadata map[string]string) error {