diff options
author | Valery Piashchynski <[email protected]> | 2023-02-27 11:21:19 +0100 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2023-02-27 11:21:19 +0100 |
commit | 952a1b6c281a4f09cced9488bf3a2056c9f42028 (patch) | |
tree | 4a03b3ca1378a81239c39529edd63f174e61abee | |
parent | 2acdcbce00382816a0b4758b0dc88ea4a0f3a9e6 (diff) |
fix: index_out_of_range panic
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r-- | .golangci.yml | 1 | ||||
-rw-r--r-- | internal/cli/jobs/command.go | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/.golangci.yml b/.golangci.yml index 0e6f5b96..0533b9eb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -54,7 +54,6 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/ - errorlint # find code that will cause problems with the error wrapping scheme introduced in Go 1.13 - exhaustive # check exhaustiveness of enum switch statements - exportloopref # checks for pointers to enclosing loop variables - - funlen # Tool for detection of long functions - gochecknoglobals # Checks that no globals are present in Go code - gocognit # Computes and checks the cognitive complexity of functions - goconst # Finds repeated strings that could be replaced by a constant diff --git a/internal/cli/jobs/command.go b/internal/cli/jobs/command.go index 589b7710..adc930f8 100644 --- a/internal/cli/jobs/command.go +++ b/internal/cli/jobs/command.go @@ -35,6 +35,10 @@ func NewCommand(cfgFile *string, override *[]string, silent *bool) *cobra.Comman return errors.E(op, errors.Str("no configuration file provided")) } + if len(args) == 0 { + return errors.Str("incorrect command usage, should be: rr jobs pause/resume/destroy/list") + } + // for the commands other than list, args[1] should contain list of pipelines to pause/resume/destroy if !listPipes && len(args[0]) == 0 { return errors.Str("pause/resume/destroy commands should have list of the pipelines as second arg") |