docs(goctl): goctl 1.3.4 migration note (#1780)

* docs(goctl): goctl 1.3.4 migration note

* adds a simple lang check
* adds migration notes

* chore: remove i18n

* chore: remove todo
This commit is contained in:
Fyn
2022-04-18 14:42:13 +08:00
committed by GitHub
parent c6ab11b14f
commit 036d803fbb
4 changed files with 163 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
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
}