Skip to content

Commit 50cdb32

Browse files
committed
Lint
1 parent a2f68ea commit 50cdb32

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cli/organization.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ func (r *RootCmd) currentOrganization() *clibase.Cmd {
3232
client = new(codersdk.Client)
3333
formatter = cliui.NewOutputFormatter(
3434
cliui.ChangeFormatterData(cliui.TextFormat(), func(data any) (any, error) {
35-
typed := data.([]codersdk.Organization)
35+
typed, ok := data.([]codersdk.Organization)
36+
if !ok {
37+
// This should never happen
38+
return "", fmt.Errorf("expected []Organization, got %T", data)
39+
}
3640
if len(typed) != 1 {
3741
return "", fmt.Errorf("expected 1 organization, got %d", len(typed))
3842
}

0 commit comments

Comments
 (0)