基本語法
可參考:https://gobyexample.com/string-formatting
印出struct
fmt.Printf("%+v\n", r)byteArray []byte 轉為string
string(somedata[:])處理錯誤訊息
使用err.Error()轉為字串
if err != nil {
if err.Error() == "leveldb: not found" {
......
}
fmt.Printf("err %s \n", err)
}Last updated
Was this helpful?