From f7d20adcb5edbcce3f4ccc6cafca7a5fedbf9c1c Mon Sep 17 00:00:00 2001 From: Tobias Lindberg Date: Tue, 23 Sep 2025 14:05:41 +0200 Subject: [PATCH] chore: use splitseq instead of split --- src/TibiaCreaturesCreature.go | 4 ++-- src/TibiaGuildsGuild.go | 2 +- src/TibiaWorldsWorld.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/TibiaCreaturesCreature.go b/src/TibiaCreaturesCreature.go index bc17f849..45f3c8e4 100644 --- a/src/TibiaCreaturesCreature.go +++ b/src/TibiaCreaturesCreature.go @@ -153,8 +153,8 @@ func TibiaCreaturesCreatureImpl(race string, BoxContentHTML string, url string) CreatureExperiencePoints = TibiaDataStringToInteger(subma3[0][1]) if subma3[0][2] != "nothing" { CreatureIsLootable = true - CreatureLootListTmp := strings.Split(strings.Replace(strings.Replace(subma3[0][2], "items ", "", 1), " and sometimes other ", "", 1), ", ") - for _, str := range CreatureLootListTmp { + CreatureLootListTmp := strings.SplitSeq(strings.Replace(strings.Replace(subma3[0][2], "items ", "", 1), " and sometimes other ", "", 1), ", ") + for str := range CreatureLootListTmp { if str != "" { CreatureLootList = append(CreatureLootList, str) } diff --git a/src/TibiaGuildsGuild.go b/src/TibiaGuildsGuild.go index e0e41e63..69320617 100644 --- a/src/TibiaGuildsGuild.go +++ b/src/TibiaGuildsGuild.go @@ -122,7 +122,7 @@ func TibiaGuildsGuildImpl(guild string, BoxContentHTML string, url string) (Guil return GuildResponse{}, fmt.Errorf("[error] TibiaGuildsGuildImpl failed at InnerTableContainerTMPB ReaderHTML.Find, err: %s", err) } - for _, line := range strings.Split(strings.TrimSuffix(InnerTableContainerTMPB, "\n"), "\n") { + for line := range strings.SplitSeq(strings.TrimSuffix(InnerTableContainerTMPB, "\n"), "\n") { // Guild information if !GuildDescriptionFinished { // First line is the description.. diff --git a/src/TibiaWorldsWorld.go b/src/TibiaWorldsWorld.go index 9423cafe..87ff7615 100644 --- a/src/TibiaWorldsWorld.go +++ b/src/TibiaWorldsWorld.go @@ -136,8 +136,8 @@ func TibiaWorldsWorldImpl(world string, BoxContentHTML string, url string) (Worl if WorldsInformationLeftColumn == "World Quest Titles" { if WorldsInformationRightColumn != "This game world currently has no title." { - WorldsQuestTitlesTmp := strings.Split(WorldsInformationRightColumn, ", ") - for _, str := range WorldsQuestTitlesTmp { + WorldsQuestTitlesTmp := strings.SplitSeq(WorldsInformationRightColumn, ", ") + for str := range WorldsQuestTitlesTmp { if str != "" { WorldsQuestTitles = append(WorldsQuestTitles, TibiaDataRemoveURLs(str)) }