From 9a032e177d0ad7698af1a062e604b1924d01dfc4 Mon Sep 17 00:00:00 2001 From: filifa Date: Sun, 6 Apr 2025 22:08:42 -0400 Subject: [PATCH] fix content --- cmd/content.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmd/content.go b/cmd/content.go index 1f41ddd..5a7530d 100644 --- a/cmd/content.go +++ b/cmd/content.go @@ -18,29 +18,27 @@ package cmd import ( "context" - "encoding/json" "fmt" + "io" "log" "github.com/spf13/cobra" - "scm.dairydemon.net/filifa/mlbstats/api" ) func content(cmd *cobra.Command, args []string) { - client := api.NewAPIClient(api.NewConfiguration()) - req := client.GameAPI.Content(context.Background(), gamePk) + req := statsAPIClient.GameAPI.Content(context.Background(), gamePk) resp, err := req.Execute() if err != nil { log.Fatal(err) } - json, err := json.Marshal(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } - fmt.Println(string(json)) + fmt.Println(string(body)) } // contentCmd represents the content command