Skip to content

azd ext source remove with no arguments panics #5037

@JeffreyCA

Description

@JeffreyCA
$ azd ext source remove

Remove extension source (azd extension source remove)

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

goroutine 1 [running]:
github.com/azure/azure-dev/cli/azd/cmd.(*extensionSourceRemoveAction).Run(0xc000296780, {0x1725488, 0xc000296240})
        /workspaces/azure-dev/cli/azd/cmd/extension.go:861 +0x37a
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x1725488, 0xc000296240})
        /workspaces/azure-dev/cli/azd/cmd/middleware/middleware.go:129 +0x429
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*TelemetryMiddleware).Run(0xc00028a0f0, {0x1725488, 0xc00024f9e0}, 0xc000256c00)
        /workspaces/azure-dev/cli/azd/cmd/middleware/telemetry.go:81 +0x8e6
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x1725488, 0xc00024f9e0})
        /workspaces/azure-dev/cli/azd/cmd/middleware/middleware.go:112 +0x2b8
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*UxMiddleware).Run(0xc000280060, {0x1725488, 0xc00024f9e0}, 0xc000256c00)
        /workspaces/azure-dev/cli/azd/cmd/middleware/ux.go:35 +0xa5
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x1725488, 0xc00024f9e0})
        /workspaces/azure-dev/cli/azd/cmd/middleware/middleware.go:112 +0x2b8
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*DebugMiddleware).Run(0xc000280030, {0x1725488, 0xc00024f9e0}, 0xc000256c00)
        /workspaces/azure-dev/cli/azd/cmd/middleware/debug.go:51 +0x382
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x1725488, 0xc00024f9e0})
        /workspaces/azure-dev/cli/azd/cmd/middleware/middleware.go:112 +0x2b8
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction(0xc000260a40, {0x1725488, 0xc00024f9e0}, 0xc00041af00, {0xc000262810, 0x22})
        /workspaces/azure-dev/cli/azd/cmd/middleware/middleware.go:133 +0x137
github.com/azure/azure-dev/cli/azd/cmd.(*CobraBuilder).configureActionResolver.func1(0xc0003d4b08, {0x2091b20, 0x0, 0x0})
        /workspaces/azure-dev/cli/azd/cmd/cobra_builder.go:133 +0x37c
github.com/spf13/cobra.(*Command).execute(0xc0003d4b08, {0x2091b20, 0x0, 0x0})
        /go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:856 +0x68a
github.com/spf13/cobra.(*Command).ExecuteC(0xc0004e6848)
        /go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:974 +0x38d
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:895
main.main()
        /workspaces/azure-dev/cli/azd/main.go:65 +0x24b

@wbreza FYI

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions