Go操作CSV相关功能
- 访问浏览器导出csv功能
package main
import (
"bytes"
"encoding/csv"
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", hello)
http.ListenAndServe(":9090", nil)
}
func hello(w http.ResponseWriter, r *http.Request) {
buff := new(bytes.Buffer)
buff.WriteString("\xEF\xBB\xBF")
csvWriter := csv.NewWriter(buff)
// 报表头
csvWriter.