Skip to content

Crash: civo objectstore credential secret panics with no arguments #601

Description

@karthik120710

Description

Running civo objectstore credential secret without --access-key and without a positional argument crashes with an index-out-of-range panic instead of showing a usage error.

File: cmd/objectstore/objectstore_credential_secret.go:33

} else if args[0] != "" {

No Args: validator is set on this command, so args can be empty when this line runs.

Steps to reproduce

civo objectstore credential secret

Expected

A friendly error like "You must provide an access key. See --help for more information." (the command already has this message at line 38, but it's unreachable due to the panic above).

Actual

panic: runtime error: index out of range [0] with length 0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions