fix: replace Split with SplitSeq as it's a loop (thanks lsp)

This commit is contained in:
2025-12-01 23:09:30 +01:00
parent b8ab5fae7b
commit 8e831d85fe

View File

@@ -15,7 +15,7 @@ func init() {
func ParseInput(filepath string) map[string]string { func ParseInput(filepath string) map[string]string {
content, _ := os.ReadFile(filepath) content, _ := os.ReadFile(filepath)
instructions := make(map[string]string) instructions := make(map[string]string)
for _, line := range strings.Split(string(content), "\n") { for line := range strings.SplitSeq(string(content), "\n") {
if parts := strings.Split(line, " -> "); len(parts) == 2 { if parts := strings.Split(line, " -> "); len(parts) == 2 {
instructions[parts[1]] = parts[0] instructions[parts[1]] = parts[0]
} }