Last updated 5 years ago
Was this helpful?
可參考:
印出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) }