set default sport differently

This commit is contained in:
filifa 2024-07-28 22:41:45 -05:00
parent 095cd4a0b4
commit e1e0225612
1 changed files with 2 additions and 7 deletions

View File

@ -27,7 +27,7 @@ import (
var date string
var team teamFlag
var sport sportFlag
var sport = sportFlag("mlb")
func schedule(cmd *cobra.Command, args []string) {
var teamId string
@ -37,12 +37,7 @@ func schedule(cmd *cobra.Command, args []string) {
teamId = strconv.Itoa(int(teamIDs[string(team)]))
}
var sportId string
if sport == "" {
sportId = strconv.Itoa(int(statsapi.MLB))
} else {
sportId = strconv.Itoa(int(sportIDs[string(sport)]))
}
sportId := strconv.Itoa(int(sportIDs[string(sport)]))
sched, err := statsapi.RequestSchedule(sportId, teamId, date)
if err != nil {