mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-08 15:39:59 +08:00
28 lines
633 B
Go
28 lines
633 B
Go
|
|
package migrationnotes
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/urfave/cli"
|
||
|
|
"github.com/zeromicro/go-zero/tools/goctl/config"
|
||
|
|
"github.com/zeromicro/go-zero/tools/goctl/util/format"
|
||
|
|
)
|
||
|
|
|
||
|
|
// BeforeCommands run before comamnd run to show some migration notes
|
||
|
|
func BeforeCommands(ctx *cli.Context) error {
|
||
|
|
if err := migrateBefore1_3_4(ctx); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func getModelSuffix(style string) (string, error) {
|
||
|
|
cfg, err := config.NewConfig(style)
|
||
|
|
if err != nil {
|
||
|
|
return "", err
|
||
|
|
}
|
||
|
|
baseSuffix, err := format.FileNamingFormat(cfg.NamingFormat, "_model")
|
||
|
|
if err != nil {
|
||
|
|
return "", err
|
||
|
|
}
|
||
|
|
return baseSuffix + ".go", nil
|
||
|
|
}
|