死磕row.Cells undefined (type *xlsx.Row has no field or method

当开始写这篇文章时,终于松一口气了。

目录

问题描述与排查过程

解决方案


问题描述与排查过程

接手了以前同事开发的项目,编译项目报错如下:

提示xlFile.Sheet[readInfo.SheetName].Rows undefined (type *xlsx.Sheet has no field or method Rows)

row.Cells undefined (type *xlsx.Row has no field or method Cells)

rows[0].Cells undefined (type *xlsx.Row has no field or method Cells)等等

用到了"github.com/tealeg/xlsx"这个库,代码中情形如下:

lock