- Notifications
You must be signed in to change notification settings - Fork928
Closed
Description
Summary
When you doparameters list
with 0 parameters, you get a panic.
$ ./coder parameters listpanic: runtime error: index out of range [0] with length 0goroutine 1 [running]:github.com/coder/coder/cli.parameterList.func1(0xc000259b80, {0xecfa7f0, 0x0, 0x0})/home/runner/work/coder/coder/cli/parameterlist.go:28 +0x6e5github.com/spf13/cobra.(*Command).execute(0xc000259b80, {0xecfa7f0, 0x0, 0x0})/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:856 +0x60egithub.com/spf13/cobra.(*Command).ExecuteC(0xc00013ea00)/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3bcgithub.com/spf13/cobra.(*Command).Execute(...)/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902main.main()/home/runner/work/coder/coder/cmd/coder/main.go:10 +0x1esteven ~/Downloads/example $
Current Behavior (steps to reproduce)
A index out of bounds panic.
- Start a new dev server
./coder start --dev
- List params
./coder parameters list
Desired Behavior
Return an empty list
Metadata
Metadata
Assignees
Labels
No labels