Skip to content

Commit

Permalink
Don't send an optional function parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Piccirello committed Jan 20, 2020
1 parent 7b8fd77 commit f7628dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ doppler run --token=123 -- printenv`,
}
}
if fallbackPath == "" {
utils.HandleError(errors.New("invalid fallback file path"), "")
utils.HandleError(errors.New("invalid fallback file path"))
}
absFallbackPath, err := filepath.Abs(fallbackPath)
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/printer/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func ActivityLog(log models.ActivityLog, jsonFlag bool, diff bool) {
func JSON(structure interface{}) {
resp, err := json.Marshal(structure)
if err != nil {
utils.HandleError(err, "")
utils.HandleError(err)
}

fmt.Println(string(resp))
Expand Down
8 changes: 4 additions & 4 deletions pkg/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func Exists(path string) bool {
func Cwd() string {
cwd, err := os.Executable()
if err != nil {
HandleError(err, "")
HandleError(err)
}
return filepath.Dir(cwd)
}
Expand Down Expand Up @@ -103,7 +103,7 @@ func GetBool(value string, def bool) bool {
func GetBoolFlag(cmd *cobra.Command, flag string) bool {
b, err := strconv.ParseBool(cmd.Flag(flag).Value.String())
if err != nil {
HandleError(err, "")
HandleError(err)
}
return b
}
Expand Down Expand Up @@ -132,7 +132,7 @@ func GetFlagIfChanged(cmd *cobra.Command, flag string, def string) string {
func GetIntFlag(cmd *cobra.Command, flag string, bits int) int {
number, err := strconv.ParseInt(cmd.Flag(flag).Value.String(), 10, bits)
if err != nil {
HandleError(err, "")
HandleError(err)
}

return int(number)
Expand All @@ -142,7 +142,7 @@ func GetIntFlag(cmd *cobra.Command, flag string, bits int) int {
func GetDurationFlag(cmd *cobra.Command, flag string) time.Duration {
value, err := time.ParseDuration(cmd.Flag(flag).Value.String())
if err != nil {
HandleError(err, "")
HandleError(err)
}
return value
}
Expand Down

0 comments on commit f7628dd

Please sign in to comment.