在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/GO/ 初學go報錯cannot use '\u0000' (type rune) as

初學go報錯cannot use '\u0000' (type rune) as type string

package main

 import (
     "github.com/tealeg/xlsx"
 )

 func main() {
     file, err := xlsx.OpenFile("./Workbook.xlsx")
     if err != nil {
         panic(err)
     }
     first := file.Sheets[0]
     row := first.AddRow()
     row.SetHeightCM(1)
     cell := row.AddCell()
     cell.Value = "1"
     cell = row.AddCell()
     cell.Value = "張三"
     cell = row.AddCell()
     cell.Value = "男"
     cell = row.AddCell()
     cell.Value = "18"

     err = file.Save('./Workbook.xlsx')
     if err != nil {
         panic(err)
     }

 }
回答
編輯回答
尛憇藌

字符串用雙引號,單引號是rune類型

2018年1月6日 13:30