Closed ahdong2007 closed 4 months ago
I have a function to get the primary key columns from a table. How can I use go-sqlmock to create a test case for this function?
Thansk in advance!
`type Mvl2Json struct { sync.Mutex db sql.DB schemaName string tableName string mvlName string logger logrus.Logger primaryKey []string lobColunms []string currentSeq int64 // 当前处理到的sequence$$ }
// primaryKey, 查询对象的主键列 func (m *Mvl2Json) PrimaryKey() {
... m.primaryKey = append(m.primaryKey, primaryKeyColunm)
}`
Hi @ahdong2007! Closing as there is not enough information to help you, unfortunately. If the problem persists, reopen and provide the following information:
sqlmock
Thank you!
I have a function to get the primary key columns from a table. How can I use go-sqlmock to create a test case for this function?
Thansk in advance!
`type Mvl2Json struct { sync.Mutex db sql.DB schemaName string tableName string mvlName string logger logrus.Logger primaryKey []string lobColunms []string currentSeq int64 // 当前处理到的sequence$$ }
// primaryKey, 查询对象的主键列 func (m *Mvl2Json) PrimaryKey() {
}`