diff --git a/gotasks/specgen_task.go b/gotasks/specgen_task.go index 921e8c8..438b694 100644 --- a/gotasks/specgen_task.go +++ b/gotasks/specgen_task.go @@ -412,7 +412,7 @@ func unmarshalXmlFile(file *zip.File, data interface{}) error { return err } decoder := xml.NewDecoder(r) - r.Close() + defer r.Close() return decoder.Decode(data) }