package util import ( "bufio" "io" ) func ReadLines(r io.Reader) ([]string, error) { lines := []string{} scanner := bufio.NewScanner(r) for scanner.Scan() { lines = append(lines, scanner.Text()) } if err := scanner.Err(); err != nil { return []string{}, err } return lines, nil }