Go入门笔记43-HGet查询

示例代码如下

value, error := db.HGet(([]byte)(id), []byte(feildName))
if error != nil {
	return xxx, nil
}
if value == nil {
	continue
}

这里如果没有读到数据,注意返回的数据将是nil.无error。

posted @ 2021-11-07 17:29  zhaogaojian  阅读(125)  评论(0编辑  收藏  举报