From f5c43a8b71dc09ae5f19b64df825874e1c16a6bd Mon Sep 17 00:00:00 2001 From: godcong Date: Thu, 6 Feb 2020 02:05:03 +0800 Subject: [PATCH] update fate --- cmd/console/name.go | 6 ++---- config/config.go | 4 ++-- fate_test.go | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cmd/console/name.go b/cmd/console/name.go index 065c4cba..ca939c75 100644 --- a/cmd/console/name.go +++ b/cmd/console/name.go @@ -20,20 +20,18 @@ func cmdName() *cobra.Command { Use: "name", Short: "output the name", Run: func(cmd *cobra.Command, args []string) { - fmt.Printf("config will output to %s/config.json\n", path) config.DefaultJSONPath = path cfg := config.LoadConfig() fmt.Printf("config loaded: %+v", cfg) bornTime, e := time.Parse(chronos.DateFormat, born) if e != nil { - return + log.Fatalw("parseborn", "error", e) } f := fate.NewFate(last, bornTime, fate.ConfigOption(cfg), fate.SexOption(fate.Sex(sex))) e = f.MakeName(context.Background()) if e != nil { - log.Errorw("makename", "error", e) - return + log.Fatalw("makename", "error", e) } }, } diff --git a/config/config.go b/config/config.go index 6ea501c1..d8cfc7a3 100644 --- a/config/config.go +++ b/config/config.go @@ -91,8 +91,8 @@ func DefaultConfig() *Config { return &Config{ RunInit: false, FilterMode: 0, - StrokeMax: 3, - StrokeMin: 18, + StrokeMax: 18, + StrokeMin: 3, HardFilter: false, FixBazi: false, SupplyFilter: true, diff --git a/fate_test.go b/fate_test.go index 040d33e7..ad99d59d 100644 --- a/fate_test.go +++ b/fate_test.go @@ -13,7 +13,7 @@ func init() { } func TestFate_RunMakeName(t *testing.T) { - born := chronos.New("2020/01/14 02:45").Solar().Time() + born := chronos.New("2020/02/06 15:45").Solar().Time() last := "张" cfg := config.DefaultConfig() cfg.BaguaFilter = true