打开文件直接失败了,是接受文件内容的变量空间不够嘛?这种情况不应该出现在打开文件时吧,大佬们,救救~
import (
...
"github.com/tealeg/xlsx"
)
func main() {
...
xlFile, err := xlsx.OpenFile(file.Name())
if err != nil {
fmt.Printf("open file: %s --> failed: %s\n", file.Name(), err)
}
open file: test.xlsx --> failed: runtime error: index out of range [63] with length 0
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x51d3db]
goroutine 1 [running]:
main.main()
c:/GoWorks/src/github.com/xxx/project/excel/main.go:39 +0x3cb
exit status 2