fusenapi/generator/gorm_gen_test.go

26 lines
614 B
Go
Raw Normal View History

2023-06-16 10:52:24 +00:00
package main
import (
2023-06-21 04:21:56 +00:00
"log"
"regexp"
2023-06-16 10:52:24 +00:00
"testing"
_ "github.com/go-sql-driver/mysql"
)
func TestXMain(t *testing.T) {
2023-06-21 04:21:56 +00:00
a := " FsAddress *FsAddressModel // fs_address 用户地址表"
re := regexp.MustCompile(`([A-Za-z0-9_]+) [^/]+ // ([^ ]+) (.+)$`)
for _, line := range re.FindStringSubmatch(a) {
log.Println(line)
}
2023-08-24 03:47:22 +00:00
2023-06-21 04:21:56 +00:00
log.Println(re.FindStringSubmatch(a))
// testGenDir = "../" + testGenDir
// GenAllModels(testGenDir, TableNameComment{
// Name: "FsFont",
// Comment: "测试",
// })
2023-06-16 10:52:24 +00:00
// Now you can use the generated GORM model to interact with the database
}