From 5dd0b4aec2931079e064f1fb393b034ce4934540 Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 6 Nov 2020 20:03:13 +0800 Subject: using POSIX directory separator in zip path with Windows --- excelize.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'excelize.go') diff --git a/excelize.go b/excelize.go index 3a511d1..2cbf54d 100644 --- a/excelize.go +++ b/excelize.go @@ -22,7 +22,6 @@ import ( "io/ioutil" "os" "path" - "path/filepath" "strconv" "strings" "sync" @@ -346,9 +345,7 @@ func (f *File) AddVBAProject(bin string) error { return errors.New("unsupported VBA project extension") } f.setContentTypePartVBAProjectExtensions() - wbPath := f.getWorkbookPath() - wbRelsPath := strings.TrimPrefix(filepath.Join(filepath.Dir(wbPath), "_rels", filepath.Base(wbPath)+".rels"), string(filepath.Separator)) - wb := f.relsReader(wbRelsPath) + wb := f.relsReader(f.getWorkbookRelsPath()) var rID int var ok bool for _, rel := range wb.Relationships { -- cgit v1.2.1