(file string)
| 24 | ) |
| 25 | |
| 26 | func importFile(file string) { |
| 27 | f, e := os.Open(file) |
| 28 | if e != nil { |
| 29 | Fatalf("failed to open %s: %s", file, e.Error()) |
| 30 | } |
| 31 | defer f.Close() |
| 32 | reader := bufio.NewReader(f) |
| 33 | for { |
| 34 | line, _, e := reader.ReadLine() |
| 35 | if e == io.EOF { |
| 36 | break |
| 37 | } |
| 38 | if e != nil { |
| 39 | Fatalf("error reading %s: %s", file, e.Error()) |
| 40 | } |
| 41 | text := string(line) |
| 42 | if strings.Contains(text, "TODO") { |
| 43 | println(text) |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | func DoImport(tasks TaskList, files []string) { |
| 49 | for _, file := range files { |