Rework directory structure

Co-authored-by: Héctor Hurtado <hector.hurtado@bbva.com>
This commit is contained in:
pancho horrillo
2019-10-03 12:05:53 +02:00
parent 8b7d1d69e7
commit 23128026c7
12 changed files with 12 additions and 12 deletions
+25
View File
@@ -0,0 +1,25 @@
package cmd
import (
"errors"
"os"
"github.com/spf13/cobra"
)
func getEnv(key, fallback string) string {
value, exists := os.LookupEnv(key)
if !exists {
return fallback
}
return value
}
func handlerIDRequired(cmd *cobra.Command, args []string) error {
handler, _ := cmd.Flags().GetString("handler")
if handler == "" {
return errors.New("--handler or KAPOW_HANDLER_ID is mandatory")
}
return nil
}