From ed40d95b74798653d2359fa17f02ed225981f56f Mon Sep 17 00:00:00 2001 From: filifa Date: Tue, 8 Apr 2025 00:54:15 -0400 Subject: [PATCH] change type to int --- cmd/content.go | 2 +- cmd/feed.go | 2 +- cmd/subscribe.go | 6 +++--- cmd/websocket.go | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/content.go b/cmd/content.go index ebccc39..9c7d91c 100644 --- a/cmd/content.go +++ b/cmd/content.go @@ -61,6 +61,6 @@ func init() { // Cobra supports local flags which will only run when this command // is called directly, e.g.: - contentCmd.Flags().Int32VarP(&gamePk, "gamePk", "g", 0, "game PK") + contentCmd.Flags().IntVarP(&gamePk, "gamePk", "g", 0, "game PK") contentCmd.MarkFlagRequired("gamePk") } diff --git a/cmd/feed.go b/cmd/feed.go index a6b8cbc..af434a6 100644 --- a/cmd/feed.go +++ b/cmd/feed.go @@ -61,6 +61,6 @@ func init() { // Cobra supports local flags which will only run when this command // is called directly, e.g.: - feedCmd.Flags().Int32VarP(&gamePk, "gamePk", "g", 0, "game PK") + feedCmd.Flags().IntVarP(&gamePk, "gamePk", "g", 0, "game PK") feedCmd.MarkFlagRequired("gamePk") } diff --git a/cmd/subscribe.go b/cmd/subscribe.go index 3021031..188bcb4 100644 --- a/cmd/subscribe.go +++ b/cmd/subscribe.go @@ -30,7 +30,7 @@ import ( "scm.dairydemon.net/filifa/mlbstats/api" ) -var gamePk int32 +var gamePk int func extractTimestamp(body []byte) (any, error) { var v any @@ -101,7 +101,7 @@ func patch(body []byte, client *api.APIClient) ([]byte, error) { return body, nil } -func newWebsocket(gamePk int32) (*gamedayWebsocket, <-chan error, error) { +func newWebsocket(gamePk int) (*gamedayWebsocket, <-chan error, error) { ws, err := newGamedayWebsocket(gamePk) if err != nil { return nil, nil, err @@ -225,6 +225,6 @@ func init() { // Cobra supports local flags which will only run when this command // is called directly, e.g.: - subscribeCmd.Flags().Int32VarP(&gamePk, "gamePk", "g", 0, "game PK") + subscribeCmd.Flags().IntVarP(&gamePk, "gamePk", "g", 0, "game PK") subscribeCmd.MarkFlagRequired("gamePk") } diff --git a/cmd/websocket.go b/cmd/websocket.go index c196274..2e4d8e7 100644 --- a/cmd/websocket.go +++ b/cmd/websocket.go @@ -43,7 +43,7 @@ type gamedayWebsocket struct { // NewGamedayWebsocket creates a statsapi.GamedayWebsocket using the Stats API // websocket URL and establishes a connection. -func newGamedayWebsocket(gamePk int32) (*gamedayWebsocket, error) { +func newGamedayWebsocket(gamePk int) (*gamedayWebsocket, error) { ws := gamedayWebsocket{ baseURL: url.URL{ Scheme: "wss", @@ -55,9 +55,9 @@ func newGamedayWebsocket(gamePk int32) (*gamedayWebsocket, error) { return &ws, err } -func (g *gamedayWebsocket) init(gamePk int32) error { +func (g *gamedayWebsocket) init(gamePk int) error { endpoint := url.URL{ - Path: "api/v1/game/push/subscribe/gameday/" + strconv.Itoa(int(gamePk)), + Path: "api/v1/game/push/subscribe/gameday/" + strconv.Itoa(gamePk), } url := g.baseURL.ResolveReference(&endpoint)