package one import ( "bufio" "io" ) func readLines(r io.Reader) (*graph, error) { graph := newGraph() scanner := bufio.NewScanner(r) for scanner.Scan() { graph.data = append(graph.data, scanner.Text()) } if err := scanner.Err(); err != nil { return nil, err } return graph, nil }