go 不保存文件下载
xlsxNews := excelize.NewFile()
xlsxNews.SetSheetRow("sheet1", "A1", &[]interface{}{
"publishDate", "newsId", "title"}, )
r.Response.Header().Set("Content-Type", "application/octet-stream")
r.Response.Header().Set("Content-Transfer-Encoding", "binary")
// 注意后面的attachment和filename,否则下载的时候不能自动命名文件名和文件后缀
r.Response.Header().Set("Content-Disposition", "attachment; filename="+"test.xlsx")
//r.Response.Write(file)
_ = xlsxNews.Write(r.Response.Writer)