diff --git a/main.go b/main.go index c9ebd59..a3d41ef 100644 --- a/main.go +++ b/main.go @@ -5,5 +5,8 @@ import ( ) func main() { - cmd.Execute() + err := cmd.Execute() + if err != nil { + panic(err) + } } diff --git a/pkg/cmd/root.go b/pkg/cmd/root.go index fc4150a..fcfe56a 100644 --- a/pkg/cmd/root.go +++ b/pkg/cmd/root.go @@ -13,7 +13,10 @@ var ( Long: `Monica is a CLI tool to manage Network Requests like http, grpc, etc.`, Version: "0.1.0", Run: func(cmd *cobra.Command, args []string) { - cmd.Help() + err := cmd.Help() + if err != nil { + panic(err) + } }, PersistentPreRun: func(cmd *cobra.Command, args []string) { if debug { diff --git a/pkg/net/http_test.go b/pkg/net/http_test.go index 732a347..4495395 100644 --- a/pkg/net/http_test.go +++ b/pkg/net/http_test.go @@ -16,7 +16,10 @@ func TestHTTPRequest(t *testing.T) { }, Body: "", } - res := net.HTTPRequest(req, false) + res, err := net.HTTPRequest(req, false) + if err != nil { + t.Fatal(err) + } if res.StatusCode != 200 { t.Fatalf("Expected status code 200, got %d", res.StatusCode) }