From bc3c7d51a2efe5f0ad85667a8f9636f13941d577 Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 17 Nov 2021 00:25:36 +0800 Subject: ref #65: new formula function PRICE - fix COUPPCD result accuracy issue - update close spreadsheet example in documentation and README --- picture.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'picture.go') diff --git a/picture.go b/picture.go index 332c639..2956ff1 100644 --- a/picture.go +++ b/picture.go @@ -481,14 +481,20 @@ func (f *File) getSheetRelationshipsTargetByID(sheet, rID string) string { } // GetPicture provides a function to get picture base name and raw content -// embed in XLSX by given worksheet and cell name. This function returns the -// file name in XLSX and file contents as []byte data types. For example: +// embed in spreadsheet by given worksheet and cell name. This function +// returns the file name in spreadsheet and file contents as []byte data +// types. For example: // // f, err := excelize.OpenFile("Book1.xlsx") // if err != nil { // fmt.Println(err) // return // } +// defer func() { +// if err := f.Close(); err != nil { +// fmt.Println(err) +// } +// }() // file, raw, err := f.GetPicture("Sheet1", "A2") // if err != nil { // fmt.Println(err) @@ -497,9 +503,6 @@ func (f *File) getSheetRelationshipsTargetByID(sheet, rID string) string { // if err := ioutil.WriteFile(file, raw, 0644); err != nil { // fmt.Println(err) // } -// if err = f.Close(); err != nil { -// fmt.Println(err) -// } // func (f *File) GetPicture(sheet, cell string) (string, []byte, error) { col, row, err := CellNameToCoordinates(cell) -- cgit v1.2.1