#2611·pgx

驱动程序。值为空时,值器的存在优先于编解码器

作者: jaltavilla创建于 2026年7月22日更新于 2026年8月3日
标签bug

type textEncodePlan struct{}

func (plan textEncodePlan) Encode(value any, buf []byte) (newBuf []byte, err error) { switch src := value.(type) { case *uuid.UUID: if src == nil { return nil, nil } return plan.encodeUUID(*src, buf)

case uuid.UUID:
	return plan.encodeUUID(src, buf)

default:
	return nil, fmt.Errorf("cannot encode %T as uuid", src)
}

}