package cmd import ( "github.com/sirupsen/logrus" "github.com/spf13/cobra" "pastebin/register" ) var ( apiServerCommand = &cobra.Command{ Use: "api", Short: "start api server", Long: "start api server", Run: func(cmd *cobra.Command, args []string) { router := register.NewRouter() if err := router.Register(); err != nil { logrus.Errorf("register router failed: %v", err) } }, } )