From 551fb8a9e4b03fe718a339e75aeacc8b5581378a Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 13 Aug 2022 11:21:59 +0800 Subject: This closes #1244 and closes #1314, improving the compatibility with Google Sheet - Format code with `gofmt` --- excelize.go | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'excelize.go') diff --git a/excelize.go b/excelize.go index 6603db0..ef438dd 100644 --- a/excelize.go +++ b/excelize.go @@ -92,10 +92,10 @@ type Options struct { // spreadsheet file struct for it. For example, open spreadsheet with // password protection: // -// f, err := excelize.OpenFile("Book1.xlsx", excelize.Options{Password: "password"}) -// if err != nil { -// return -// } +// f, err := excelize.OpenFile("Book1.xlsx", excelize.Options{Password: "password"}) +// if err != nil { +// return +// } // // Close the file by Close function after opening the spreadsheet. func OpenFile(filename string, opt ...Options) (*File, error) { @@ -403,21 +403,20 @@ func (f *File) addRels(relPath, relType, target, targetMode string) int { // // For example: // -// -// -// SUM(Sheet2!D2,Sheet2!D11) -// 100 -// -// +// +// +// SUM(Sheet2!D2,Sheet2!D11) +// 100 +// +// // // to // -// -// -// SUM(Sheet2!D2,Sheet2!D11) -// -// -// +// +// +// SUM(Sheet2!D2,Sheet2!D11) +// +// func (f *File) UpdateLinkedValue() error { wb := f.workbookReader() // recalculate formulas @@ -445,16 +444,15 @@ func (f *File) UpdateLinkedValue() error { // AddVBAProject provides the method to add vbaProject.bin file which contains // functions and/or macros. The file extension should be .xlsm. For example: // -// if err := f.SetSheetPrOptions("Sheet1", excelize.CodeName("Sheet1")); err != nil { -// fmt.Println(err) -// } -// if err := f.AddVBAProject("vbaProject.bin"); err != nil { -// fmt.Println(err) -// } -// if err := f.SaveAs("macros.xlsm"); err != nil { -// fmt.Println(err) -// } -// +// if err := f.SetSheetPrOptions("Sheet1", excelize.CodeName("Sheet1")); err != nil { +// fmt.Println(err) +// } +// if err := f.AddVBAProject("vbaProject.bin"); err != nil { +// fmt.Println(err) +// } +// if err := f.SaveAs("macros.xlsm"); err != nil { +// fmt.Println(err) +// } func (f *File) AddVBAProject(bin string) error { var err error // Check vbaProject.bin exists first. -- cgit v1.2.1