MCPcopy Create free account
hub / github.com/alecthomas/devtodo2 / importFile

Function importFile

importer.go:26–46  ·  view source on GitHub ↗
(file string)

Source from the content-addressed store, hash-verified

24)
25
26func 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
48func DoImport(tasks TaskList, files []string) {
49 for _, file := range files {

Callers 1

DoImportFunction · 0.85

Calls 1

FatalfFunction · 0.85

Tested by

no test coverage detected