From 544ef18a8cb9949fcb8833c6d2816783c90f3318 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 5 Jul 2021 00:03:56 +0800 Subject: - Support concurrency iterate rows and columns - Rename exported field `File.XLSX` to `File.Pkg` - Exported error message --- table.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'table.go') diff --git a/table.go b/table.go index 12ef41a..620cf20 100644 --- a/table.go +++ b/table.go @@ -105,11 +105,12 @@ func (f *File) AddTable(sheet, hcell, vcell, format string) error { // folder xl/tables. func (f *File) countTables() int { count := 0 - for k := range f.XLSX { - if strings.Contains(k, "xl/tables/table") { + f.Pkg.Range(func(k, v interface{}) bool { + if strings.Contains(k.(string), "xl/tables/table") { count++ } - } + return true + }) return count } -- cgit v1.2.1