From 10874ba9fce45bb89191d330f5230702a06dccb3 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Sun, 19 Dec 2021 02:12:41 +0800 Subject: [PATCH] update --- attribute/attribute.go | 5 ++--- helper.go | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/attribute/attribute.go b/attribute/attribute.go index a322bd0..bace623 100644 --- a/attribute/attribute.go +++ b/attribute/attribute.go @@ -21,16 +21,15 @@ type Attribute struct { var l zerolog.Logger -func Init() error { +func Init() { l = log.With().Str("mod", "attribute").Logger() l.Debug().Str("service", "attribute.Service"). Msg("Migrating database for attribute.Service ...") err := store.Migrate(&Attribute{}) if err != nil { - return err + panic(err) } - return nil } func Add(Key, Description, Default string) error { diff --git a/helper.go b/helper.go index 0ab5e95..4534ba7 100644 --- a/helper.go +++ b/helper.go @@ -18,9 +18,7 @@ func Default() *system.System { sys := system.New() server := server.New(viper.GetString("name")) - if err := attribute.Init(); err != nil { - panic(err) - } + attribute.Init() auth.Setup() auth.SetDB(store.DB)