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

Function loadTaskList

cmd/todo2/main.go:289–301  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

287}
288
289func loadTaskList() (tasks devtodo2.TaskList, err error) {
290 if file, err := os.Open(*fileFlag); err == nil {
291 defer file.Close()
292 loader := devtodo2.NewJSONIO()
293 return loader.Deserialize(file)
294 }
295 if file, err := os.Open(*legacyFileFlag); err == nil {
296 defer file.Close()
297 loader := devtodo2.NewLegacyIO()
298 return loader.Deserialize(file)
299 }
300 return nil, nil
301}
302
303func saveTaskList(tasks devtodo2.TaskList) {
304 path := *fileFlag

Callers 1

mainFunction · 0.85

Calls 3

NewJSONIOFunction · 0.92
NewLegacyIOFunction · 0.92
DeserializeMethod · 0.65

Tested by

no test coverage detected