package two import ( "bufio" "io" "strings" ) func parseLines(r io.Reader) ([]string, []string, error) { var stripes, designs []string var inDesigns bool scanner := bufio.NewScanner(r) for scanner.Scan() { line := scanner.Text() if line == "" { inDesigns = true continue } if inDesigns { designs = append(designs, line) } else { stripes = strings.Split(line, ", ") } } if err := scanner.Err(); err != nil { return nil, nil, err } return stripes, designs, nil }