use log.Fatal instead panic on config errors
This commit is contained in:
parent
2dc0f02d1c
commit
fce1b99683
7 changed files with 22 additions and 28 deletions
|
|
@ -15,6 +15,8 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/dhax/go-base/api"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
|
@ -28,7 +30,7 @@ var serveCmd = &cobra.Command{
|
|||
Run: func(cmd *cobra.Command, args []string) {
|
||||
server, err := api.NewServer()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
log.Fatal(err)
|
||||
}
|
||||
server.Start()
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue