Skip to content

Commit

Permalink
fix example/remote transaction bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiujia committed Dec 29, 2018
1 parent 9d29fb0 commit 33e6ff0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions TransactionManager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
var manager DefaultTransationManager

func TestManager(t *testing.T) {
if example.ExampleDriverName == "" || example.MysqlUri == "" || example.MysqlUri == "*" {
if example.MysqlUri == "" || example.MysqlUri == "*" {
fmt.Println("no mysql config in project, you must set the mysql link!")
return
}
engine, err := Open(example.ExampleDriverName, example.MysqlUri) //此处请按格式填写你的mysql链接,这里用*号代替
engine, err := Open("mysql", example.MysqlUri) //此处请按格式填写你的mysql链接,这里用*号代替
if err != nil {
t.Fatal(err)
}
Expand Down
5 changes: 5 additions & 0 deletions example/Example_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package example

//mysql链接格式为 用户名:密码@(数据库链接地址:端口)/数据库名称 例如root:root@(127.0.0.1:3306)/test?charset=utf8&parseTime=True&loc=Local
//此处请按格式填写你的mysql链接,这里用*号代替
const MysqlUri = "*"
5 changes: 0 additions & 5 deletions example/Example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import (
"time"
)

//mysql链接格式为 用户名:密码@(数据库链接地址:端口)/数据库名称 例如root:root@(127.0.0.1:3306)/test?charset=utf8&parseTime=True&loc=Local
//此处请按格式填写你的mysql链接,这里用*号代替
const MysqlUri = "*"


//定义mapper文件的接口和结构体
// 支持基本类型(int,string,time.Time,float...且需要指定参数名称`mapperParams:"name"以逗号隔开,且位置要和实际参数相同)
//参数中包含有*GoMybatis.Session的类型,用于自定义事务
Expand Down

0 comments on commit 33e6ff0

Please sign in to comment.