Open fightlight opened 6 months ago
It is very unfortunate that fb1aab7add52808c96c9cc10570fe73ce797b7f4 broke compatibilty with io.WriterTo
(I was the one who introduced it in 2132de1a0848794a49225470e42f91e9c34bb6da) since v2.7.0.
However, at that point restoring the compatibility would be another another breaking change. So I don't think this is fixable. Except the documentation, of course.
Note that, as a workaround, it is easy to write your own wrapper to somewhat restore that compatibility:
type myExcelizeFile = excelize.File
type myExcelizeWriterTo struct {
*myExcelizeFile
}
func (f myExcelizeWriterTo) WriteTo(w io.Writer) (int64, error) {
return f.myExcelizeFile.WriteTo(w)
}
Description
Hi! I'm migrating one of our projects from excelize v2.4.0 to v2.8.1 and can I not compile code:
I made a workaround returning
*excelize.File
instead ofio.WriterTo
, but anyway the issue (or the go doc comment) should be fixed, I think :)Steps to reproduce the issue:
excelize.NewFile()
io.WriterTo
Describe the results you received: Code doesn't compile.
Describe the results you expected: Code compiles.
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.): MacOS Ventura 13.6.6