package one import ( "bufio" "io" "strings" ) func parseLines(r io.Reader) ([][]string, error) { connections := [][]string{} scanner := bufio.NewScanner(r) for scanner.Scan() { connections = append(connections, strings.Split(scanner.Text(), "-")) } if err := scanner.Err(); err != nil { return nil, err } return connections, nil }