change type to int

This commit is contained in:
filifa 2025-04-08 00:54:15 -04:00
parent 3ddb5e2632
commit ed40d95b74
4 changed files with 8 additions and 8 deletions

View File

@ -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")
}

View File

@ -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")
}

View File

@ -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")
}

View File

@ -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)