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)
|
|
|
|
}
|
|
|
|
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
|
|
|
|
}
|