1234567891011121314151617181920 |
- package database
- import (
- "fmt"
- "testing"
- )
- const dbHost = "wallet:wallet@tcp(localhost:3306)/%s?charset=utf8mb4&parseTime=True&loc=Local"
- const wechat_path = "/wechat"
- const tool_path = "/tool"
- func Test_generateWechatDbModel(t *testing.T) {
- dsn := fmt.Sprintf(dbHost, "wechat")
- generateGormDbModel(dsn, wechat_path)
- }
- func Test_generateToolDbModel(t *testing.T) {
- dsn := fmt.Sprintf(dbHost, "tool")
- generateGormDbModel(dsn, tool_path)
- }
|