fusenapi/generator/gorm_gen_test.go
2023-06-21 12:21:56 +08:00

25 lines
613 B
Go

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