Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated workbook corrupted with Go 1.21.0 生成的excel无法打开 #1663

Closed
xugnail opened this issue Sep 18, 2023 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@xugnail
Copy link

xugnail commented Sep 18, 2023

示例代码如下:

f := excelize.NewFile()

defer func() {
  if err := f.Close(); err != nil {
	  fmt.Println(err)
  }
}()

f.SetCellValue("Sheet1", "B2", 100)

if err := f.SaveAs("Book1.xlsx"); err != nil {
          fmt.Println(err)
}

问题如下:
image

tag: 2.4.1、2.7.1、2.8.0 都有这个问题。

本地 go 版本有1.21.0,导出的excel如图无法打开

版本退回 go 1.18.10 问题解决

@xuri
Copy link
Member

xuri commented Sep 18, 2023

Thanks for your issue. If you are reporting a new issue, make sure that we do not have any duplicates already exist. If it does not work with Go 1.21.0, please reference the issues#1465, #1595, #1603, #1608, #1614, #1619, #1620, #1621, #1623, #1633, #1637, #1641, #1642, #1648, #1651, #1652, #1656, #1657 and #1660. There are some incompatible changes in the Go 1.21.0 encoding/xml library. I have given feedback to the Go team and created a patch for it (golang/go#61881), and it has been fixed on Go 1.21.1. Please using the Go 1.20.7 and previous Go released version or upgrade to Go 1.21.1 and later. I have added notice on the README and documentation website for this, and I've closed this. If you have any questions, please let me know, and reopen this anytime.

谢谢您的提问,在您创建新的问题之前,请确保不存在任何重复的问题。这与已有问题重复,请参考 #1465, #1595, #1603, #1608, #1614, #1619, #1620, #1621, #1623, #1633, #1637, #1641, #1642, #1648, #1651, #1652, #1656, #1657#1660。Go 1.21.0 对 encoding/xml 标准库做了不兼容的更改,我已将该问题反馈至 Go 团队,并提交了修复补丁 golang/go#61881,已在 Go 1.21.1 中修复。请使用 Go 1.20.7 以及更早版本,或升级 1.21.1 及以上版本。我已经为此在自述文档文档网站上添加了通知,因此我将关闭此问题。如果您有任何问题,请告诉我,并可随时重新打开。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants