go-zero/tools/goctl/model/sql/command/migrationnotes/migrationnotes.go
anqiansong 5383e29ce6
feat: Replace cli to cobra (#1855)
* Replace cli

* Replace cli

* Replace cli

* Format code

* Add compare case

* Add compare case

* Add compare case

* Support go style flag

* Support go style flag

* Add test case
2022-05-07 15:40:11 +08:00

27 lines
616 B
Go

package migrationnotes
import (
"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(dir, style string) error {
if err := migrateBefore1_3_4(dir, style); 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
}