-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
Description
RemoveRow can not remove the last row|RemoveRow 无法删除最后一行:
RemoveRow(sheetName,0)report error:invalid row number 0 []RemoveRow(sheetName,i+1)remove thei+1th row asrows[i]fromGetRows(sheetName)RemoveRow(sheetName,len(row))report error :slice bounds out of range [94:93](94:93 is example)
Steps to reproduce the issue:
var excel,err1=excelize.OpenFile(excelFile)var rows,err2=excel.GetRows(sheetName)excel.RemoveRow(sheetName,len(rows))
Describe the results you received:
panic: runtime error: slice bounds out of range [94:93]
goroutine 1 [running]:
github.com/360EntSecGroup-Skylar/excelize/v2.(*File).adjustHyperlinks(0xc000126500, 0xc00007c000, 0x5a4327, 0x11, 0x1, 0x11, 0xffffffffffffffff)
/home/wangyaoshen/go/pkg/mod/github.com/360!ent!sec!group-!skylar/excelize/[email protected]/adjust.go:117 +0x5a1
github.com/360EntSecGroup-Skylar/excelize/v2.(*File).adjustHelper(0xc000126500, 0x5a4327, 0x11, 0xc00007c001, 0x11, 0xffffffffffffffff, 0xc0000100f0, 0x2)
/home/wangyaoshen/go/pkg/mod/github.com/360!ent!sec!group-!skylar/excelize/[email protected]/adjust.go:45 +0xdd
github.com/360EntSecGroup-Skylar/excelize/v2.(*File).RemoveRow(0xc000126500, 0x5a4327, 0x11, 0x11, 0x4, 0x0)
/home/wangyaoshen/go/pkg/mod/github.com/360!ent!sec!group-!skylar/excelize/[email protected]/rows.go:436 +0x199
main.main()
/zfsyt1/B2C_RD_P2/USER/wangyaoshen/pipeline/filterExcel/main.go:146 +0x13dc
Describe the results you expected:
RemoveRow(sheetName,len(rows)) remove the len(rows) th row (the last row) as rows[len(rows)-1]
Output of go version:
go version go1.14.3 linux/amd64
Excelize version or commit ID:
v2.2.0
Environment details (OS, Microsoft Excel™ version, physical, etc.):
Metadata
Metadata
Assignees
Labels
No labels