1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
package todolist type App struct { TodoStore Store } func NewApp() *App { app := &App{TodoStore: NewFileStore()} app.TodoStore.Load() return app } func (a *App) ListTodos(input string) { formatter := NewFormatter(a.TodoStore.Todos()) formatter.Print() }