Skip to content

Commit

Permalink
Fix test and linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cortiz committed Jun 20, 2024
1 parent d1f2eb3 commit 53690ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ import (
)

func main() {
cmd.Execute()
err := cmd.Execute()
if err != nil {
panic(err)
}
}
5 changes: 4 additions & 1 deletion pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion pkg/net/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 53690ad

Please sign in to comment.