diff options
author | Jesús Espino <jespinog@gmail.com> | 2018-07-24 16:11:47 +0200 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2018-07-24 10:11:47 -0400 |
commit | bfb2640451c95b242ae7b8bb8528538b706412ef (patch) | |
tree | 0287dc30c4fa70a3c457371dfd5cfd1a7d91376f /cmd/mattermost/commands/config.go | |
parent | da124f018dbb10a41f4d4b5ecb4818baf628e940 (diff) | |
download | chat-bfb2640451c95b242ae7b8bb8528538b706412ef.tar.gz chat-bfb2640451c95b242ae7b8bb8528538b706412ef.tar.bz2 chat-bfb2640451c95b242ae7b8bb8528538b706412ef.zip |
Add idiomatic error handling in mattermost commands (#9147)
Diffstat (limited to 'cmd/mattermost/commands/config.go')
-rw-r--r-- | cmd/mattermost/commands/config.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/mattermost/commands/config.go b/cmd/mattermost/commands/config.go index d9881b050..b8630b82f 100644 --- a/cmd/mattermost/commands/config.go +++ b/cmd/mattermost/commands/config.go @@ -90,9 +90,13 @@ func configSubpathCmdF(command *cobra.Command, args []string) error { path, err := command.Flags().GetString("path") if err != nil { return errors.Wrap(err, "failed reading path") - } else if path == "" { + } + + if path == "" { return utils.UpdateAssetsSubpathFromConfig(a.Config()) - } else if err := utils.UpdateAssetsSubpath(path); err != nil { + } + + if err := utils.UpdateAssetsSubpath(path); err != nil { return errors.Wrap(err, "failed to update assets subpath") } |