5-6 创建 数据库失败 和关于DOC里的 .sql 怎么创建 ?
来源:5-6 资金账户模块-账户表账户插入和查询数据库访问层的测试用例编码实战
慕粉3444241
2019-07-05
问题1,没有创建成功数据?
Actual: ‘Error 1146: Table ‘po.account’ doesn’t exist’
问题2 DOC下的.sql 怎么创建?
GOROOT=/usr/local/go #gosetup
GOPATH=/Users/liyang/go #gosetup
/usr/local/go/bin/go test -c -o /private/var/folders/jv/m_yr8xkd7790bnvzqktczclw0000gn/T/___TestAccountDao_GetOne_in_imooc_com_resk_src_imooc_com_resk_core_accounts imooc.com/resk/src/imooc.com/resk/core/accounts #gosetup
/usr/local/go/bin/go tool test2json -t /private/var/folders/jv/m_yr8xkd7790bnvzqktczclw0000gn/T/___TestAccountDao_GetOne_in_imooc_com_resk_src_imooc_com_resk_core_accounts -test.v -test.run ^TestAccountDao_GetOne$ #gosetup
[5076-07-05.21:34:42.758975] INFO 测试
初始化配置
[5076-07-05.21:34:42.760808] INFO mysql.conn url:root:***@tcp(127.0.0.1:3306)/po?loc=Local&charset=utf8&parseTime=true&
up
[5076-07-05.21:34:42.764830] INFO <nil>
=== RUN TestAccountDao_GetOne
x
Failures:
* /Users/liyang/WorkProjects/resk-projects/src/imooc.com/resk/core/accounts/dao_account_test.go
Line 30:
Expected: nil
Actual: 'Error 1146: Table 'po.account' doesn't exist'
goroutine 52 [running]:
写回答
1回答
-
枫荇
2019-07-06
您好!在doc文件夹下面有建库脚本,执行脚本来创建和初始化表结构。
00
相似问题