From 53690adb740753f0da07746bb22568f51491ff27 Mon Sep 17 00:00:00 2001 From: Carlos Ortiz Date: Wed, 19 Jun 2024 21:14:58 -0600 Subject: [PATCH] Fix test and linter errors --- main.go | 5 ++++- pkg/cmd/root.go | 5 ++++- pkg/net/http_test.go | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) 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) }