use log.Fatal instead panic on config errors

This commit is contained in:
dhax 2017-10-19 00:40:25 +02:00
parent 2dc0f02d1c
commit fce1b99683
7 changed files with 22 additions and 28 deletions

View file

@ -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()
},