MCPcopy Create free account
hub / github.com/augmentable-dev/tickgit / WriteTodos

Function WriteTodos

pkg/todos/report.go:23–42  ·  view source on GitHub ↗

WriteTodos renders a report of todos

(todos ToDos, writer io.Writer)

Source from the content-addressed store, hash-verified

21
22// WriteTodos renders a report of todos
23func WriteTodos(todos ToDos, writer io.Writer) error {
24
25 t, err := template.New("todos").Parse(defaultTemplate)
26 if err != nil {
27 return err
28 }
29
30 // replace the phrase in the todo string with a "highlighted" version for console output
31 // TODO eventually make this configurable, for NO_COLOR output (or customization of color?)
32 for _, todo := range todos {
33 todo.String = strings.Replace(todo.String, todo.Phrase, "\u001b[33m"+todo.Phrase+"\u001b[0m", 1)
34 }
35
36 err = t.Execute(writer, todos)
37 if err != nil {
38 return err
39 }
40
41 return nil
42}

Callers 1

todos.goFile · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected