(filename string)
| 235 | } |
| 236 | |
| 237 | func readFileLines(filename string) ([]string, error) { |
| 238 | file, err := os.Open(filename) |
| 239 | if err != nil { |
| 240 | return nil, err |
| 241 | } |
| 242 | defer file.Close() |
| 243 | |
| 244 | var lines []string |
| 245 | scanner := bufio.NewScanner(file) |
| 246 | for scanner.Scan() { |
| 247 | lines = append(lines, scanner.Text()) |
| 248 | } |
| 249 | |
| 250 | return lines, scanner.Err() |
| 251 | } |