代码拉取完成,页面将自动刷新
package types
import (
"database/sql"
"fmt"
"reflect"
)
type Hstore struct {
v reflect.Value
append AppenderFunc
scan ScannerFunc
}
var _ ValueAppender = (*Hstore)(nil)
var _ sql.Scanner = (*Hstore)(nil)
func NewHstore(vi interface{}) *Hstore {
v := reflect.ValueOf(vi)
if !v.IsValid() {
panic(fmt.Errorf("pg.Hstore(nil)"))
}
v = reflect.Indirect(v)
if v.Kind() != reflect.Map {
panic(fmt.Errorf("pg.Hstore(unsupported %s)", v.Type()))
}
return &Hstore{
v: v,
append: HstoreAppender(v.Type()),
scan: HstoreScanner(v.Type()),
}
}
func (h *Hstore) Value() interface{} {
if h.v.IsValid() {
return h.v.Interface()
}
return nil
}
func (h *Hstore) AppendValue(b []byte, quote int) ([]byte, error) {
b = h.append(b, h.v, quote)
return b, nil
}
func (h *Hstore) Scan(b interface{}) error {
if b == nil {
return h.scan(h.v, nil)
}
return h.scan(h.v, b.([]byte))
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。