Repository: goadesign/goa (go)

Issue:
goa CLI panics when run without any args
```shell
$ goa
goa is the code generation tool for the Goa framework.
Learn more at https://goa.design.

Usage:
  ...help text...

panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
main.main()
	/Users/andy/go/pkg/mod/goa.design/goa/v3@v3.18.2/cmd/goa/main.go:25 +0x520

```

Pull request description:
Exit after usage() is shown. Fixes #3583
- Fixes panics
- Resolves Deepsource finding about extra block

Patch:
diff --git a/cmd/goa/main.go b/cmd/goa/main.go
index f7f33943..fd520f33 100644
--- a/cmd/goa/main.go
+++ b/cmd/goa/main.go
@@ -17,25 +17,26 @@ func main() {
 		path   string
 		offset int
 	)
-	{
-		if len(os.Args) == 1 {
-			usage()
-		}
+	if len(os.Args) == 1 {
+		usage()
+		return
+	}
 
-		switch os.Args[1] {
-		case "version":
-			fmt.Println("Goa version " + goa.Version())
-			os.Exit(0)
-		case "gen", "example":
-			if len(os.Args) == 2 {
-				usage()
-			}
-			cmd = os.Args[1]
-			path = os.Args[2]
-			offset = 2
-		default:
+	switch os.Args[1] {
+	case "version":
+		fmt.Println("Goa version " + goa.Version())
+		os.Exit(0)
+	case "gen", "example":
+		if len(os.Args) == 2 {
 			usage()
+			return
 		}
+		cmd = os.Args[1]
+		path = os.Args[2]
+		offset = 2
+	default:
+		usage()
+		return
 	}
 
 	var (


Test patch:
diff --git a/cmd/goa/main_test.go b/cmd/goa/main_test.go
index 04fbbf58..f9dad07c 100644
--- a/cmd/goa/main_test.go
+++ b/cmd/goa/main_test.go
@@ -35,9 +35,9 @@ func TestCmdLine(t *testing.T) {
 	}{
 		"gen": {"gen " + testPkg, false, "gen", testPkg, ".", false},
 
-		"invalid":     {"invalid " + testPkg, true, "", "", ".", false},
-		"empty":       {"", true, "", "", ".", false},
-		"invalid gen": {"invalid gen" + testPkg, true, "", "", ".", false},
+		"invalid":     {"invalid " + testPkg, true, "", "", "", false},
+		"empty":       {"", true, "", "", "", false},
+		"invalid gen": {"invalid gen" + testPkg, true, "", "", "", false},
 
 		"output":       {"gen " + testPkg + " -output " + testOutput, false, "gen", testPkg, testOutput, false},
 		"output short": {"gen " + testPkg + " -o " + testOutput, false, "gen", testPkg, testOutput, false},