type NamedArg

命名参数。NamedArg 值可以用作 Query 或 Exec 的参数,并绑定到 SQL 语句中相应的命名参数。

有关创建 NamedArg 值的更简洁方法,请参见 Named 函数。

NameArg结构如下:

type NamedArg struct {

// Name is the name of the parameter placeholder.
//
// If empty, the ordinal position in the argument list will be
// used.
//
// Name must omit any symbol prefix.
Name string

// Value is the value of the parameter.
// It may be assigned the same value types as the query
// arguments.
Value interface{}
// contains filtered or unexported fields
            }