You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
692 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package main
import (
"dsFillOut/Utils/CommonUtil"
"fmt"
"io/ioutil"
"strings"
)
func main() {
path := "./models"
fs, _ := ioutil.ReadDir(path)
for _, file := range fs {
if !file.IsDir() {
bytes, err := ioutil.ReadFile(path + "/" + file.Name())
if err != nil {
fmt.Println("error : %s", err)
return
}
content := string(bytes)
wireteString := strings.Replace(content, " int ", " int64 ", -1)
var d1 = []byte(wireteString)
ioutil.WriteFile(path+"/"+file.Name(), d1, 0666) //写入文件(字节数组)
fmt.Println(CommonUtil.GetCurrentTime(), "\t", "成功完成"+file.Name())
}
}
fmt.Println("恭喜全部实体表替换In64成功完成")
}