Browse Source

Put path back into a file

Josh Fyne 8 năm trước cách đây
mục cha
commit
bd817ea890
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      excelize.go

+ 6 - 1
excelize.go

@@ -27,7 +27,12 @@ func OpenFile(filename string) (*File, error) {
 		return nil, err
 	}
 	defer file.Close()
-	return OpenReader(file)
+	f, err := OpenReader(file)
+	if err != nil {
+		return nil, err
+	}
+	f.Path = filename
+	return f, nil
 }
 
 // OpenReader take an io.Reader and return a populated XLSX file.