中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

Golang 導(dǎo)出Excel

2018-07-20    來(lái)源:open-open

容器云強(qiáng)勢(shì)上線!快速搭建集群,上萬(wàn)Linux鏡像隨意使用
package main
    
import (
    "os"
    "encoding/csv"
)
    
func main() {
    f, err := os.Create("haha2.xls")
    if err != nil {
        panic(err)
    }
    defer f.Close()
    
    f.WriteString("\xEF\xBB\xBF") // 寫入U(xiǎn)TF-8 BOM
    
    w := csv.NewWriter(f)
    w.Write([]string{"編號(hào)","姓名","年齡"})
    w.Write([]string{"1","張三","23"})
    w.Write([]string{"2","李四","24"})
    w.Write([]string{"3","王五","25"})
    w.Write([]string{"4","趙六","26"})
    w.Flush()
}
 

標(biāo)簽:

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請(qǐng)聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點(diǎn)!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請(qǐng)與原作者聯(lián)系。

上一篇:php實(shí)現(xiàn)通過(guò)http頭禁止瀏覽器緩存

下一篇:Golang計(jì)算兩個(gè)經(jīng)度和緯度之間的距離