This commit is contained in:
onyx-and-iris 2024-12-13 19:29:32 +00:00
parent f7534c78d1
commit 054d372470

View File

@ -35,15 +35,15 @@ func ParseLines(r io.Reader) ([]*machine.Machine, error) {
matches = append(matches, m)
}
if err := scanner.Err(); err != nil {
return nil, err
}
var machines []*machine.Machine
for i := 0; i < len(matches); i += 3 {
machines = append(machines, machine.New(matches[i], matches[i+1], matches[i+2]))
}
if err := scanner.Err(); err != nil {
return nil, err
}
return machines, nil
}