fix issue in unit testing case of package internal/structs

This commit is contained in:
John Guo 2021-09-29 19:18:27 +08:00
parent 02478371f2
commit b7b4067973
2 changed files with 5 additions and 2 deletions

View File

@ -512,7 +512,7 @@ func (c *Core) Update(table string, data interface{}, condition interface{}, arg
}
// DoUpdate does "UPDATE ... " statement for the table.
// This function is usually used for custom interface definition, you do not need call it manually.
// This function is usually used for custom interface definition, you do not need to call it manually.
func (c *Core) DoUpdate(ctx context.Context, link Link, table string, data interface{}, condition string, args ...interface{}) (result sql.Result, err error) {
table = c.QuotePrefixTableName(table)
var (

View File

@ -110,7 +110,10 @@ func Test_Fields(t *testing.T) {
Pass string `my-tag1:"pass1" my-tag2:"pass2" params:"pass"`
}
var user *User
fields, _ := structs.Fields(user)
fields, _ := structs.Fields(structs.FieldsInput{
Pointer: user,
RecursiveOption: 0,
})
t.Assert(len(fields), 3)
t.Assert(fields[0].Name(), "Id")
t.Assert(fields[1].Name(), "Name")