migrationnotes.go 636 B

1234567891011121314151617181920212223242526
  1. package migrationnotes
  2. import (
  3. "github.com/wuntsong-org/go-zero-plus/tools/goctlwt/config"
  4. "github.com/wuntsong-org/go-zero-plus/tools/goctlwt/util/format"
  5. )
  6. // BeforeCommands run before comamnd run to show some migration notes
  7. func BeforeCommands(dir, style string) error {
  8. if err := migrateBefore1_3_4(dir, style); err != nil {
  9. return err
  10. }
  11. return nil
  12. }
  13. func getModelSuffix(style string) (string, error) {
  14. cfg, err := config.NewConfig(style)
  15. if err != nil {
  16. return "", err
  17. }
  18. baseSuffix, err := format.FileNamingFormat(cfg.NamingFormat, "_model")
  19. if err != nil {
  20. return "", err
  21. }
  22. return baseSuffix + ".go", nil
  23. }