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

Strange bug: gened file broken while using go1.21.0 but works fine in older versions #1621

Closed
anotherGoogleFan opened this issue Aug 23, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@anotherGoogleFan
Copy link

The code is very simple:

package main

import "github.com/xuri/excelize/v2"

func main() {
	f := excelize.NewFile()
	sheetName := "Sheet1"
	_, _ = f.NewSheet(sheetName)
	_ = f.SaveAs("temp.xlsx")
}

When I gened the temp.xlsx using go 1.20 go version go1.20.7 darwin/amd64 or older version, all things goes well;
when I used go 1.21 go version go1.21.0 darwin/amd64 the gened file cannot be opened by microsoft excel. It's said broken file.

@anotherGoogleFan anotherGoogleFan changed the title strange bug: gened file broken while using go1.21 Strange bug: gened file broken while using go1.21.0 but works fine in older versions Aug 23, 2023
@xuri xuri closed this as completed Aug 23, 2023
@xuri xuri added the duplicate This issue or pull request already exists label Aug 23, 2023
@xuri
Copy link
Member

xuri commented Aug 23, 2023

If you are reporting a new issue, make sure that we do not have any duplicates already open. This was duplicated with issues #1465, #1595, #1603, #1608, #1614, #1619 and #1620. 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 still waiting for a reply. The Go team has added golang/go#62051 to the Go 1.21.1 milestone. I suggest using the Go 1.20.7 and previous Go released version or waiting for the next Go minor releases.

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