test

package
v0.1.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package test 是用于辅助测试的包。仅限于内部使用

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonColumn

type JsonColumn struct {
	Val   User
	Valid bool
}

JsonColumn 是自定义的 JSON 类型字段 Val 字段必须是结构体指针

func (*JsonColumn) Scan

func (j *JsonColumn) Scan(src any) error

func (JsonColumn) Value

func (j JsonColumn) Value() (driver.Value, error)

Value 参考 sql.NullXXX 类型定义的

type SimpleStruct

type SimpleStruct struct {
	Id      uint64
	Bool    bool
	BoolPtr *bool

	Int    int
	IntPtr *int

	Int8    int8
	Int8Ptr *int8

	Int16    int16
	Int16Ptr *int16

	Int32    int32
	Int32Ptr *int32

	Int64    int64
	Int64Ptr *int64

	Uint    uint
	UintPtr *uint

	Uint8    uint8
	Uint8Ptr *uint8

	Uint16    uint16
	Uint16Ptr *uint16

	Uint32    uint32
	Uint32Ptr *uint32

	Uint64    uint64
	Uint64Ptr *uint64

	Float32    float32
	Float32Ptr *float32

	Float64    float64
	Float64Ptr *float64

	Byte      byte
	BytePtr   *byte
	ByteArray []byte

	String string

	// 特殊类型
	NullStringPtr  *sql.NullString
	NullInt16Ptr   *sql.NullInt16
	NullInt32Ptr   *sql.NullInt32
	NullInt64Ptr   *sql.NullInt64
	NullBoolPtr    *sql.NullBool
	NullFloat64Ptr *sql.NullFloat64
	JsonColumn     *JsonColumn
}

SimpleStruct 包含所有支持的类型

func NewSimpleStruct

func NewSimpleStruct(id uint64) *SimpleStruct

type User

type User struct {
	Name string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL