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

Method load

mcp/server.go:66–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64}
65
66func (s *Server) load() (devtodo2.TaskList, error) {
67 if f, err := os.Open(s.file); err == nil {
68 defer f.Close()
69 return devtodo2.NewJSONIO().Deserialize(f)
70 }
71 if f, err := os.Open(s.legacyFile); err == nil {
72 defer f.Close()
73 return devtodo2.NewLegacyIO().Deserialize(f)
74 }
75 return nil, nil
76}
77
78func (s *Server) save(tasks devtodo2.TaskList) error {
79 path := s.file

Callers 7

handleListMethod · 0.95
handleAddMethod · 0.95
handleDoneMethod · 0.95
handleUndoneMethod · 0.95
handleEditMethod · 0.95
handleRemoveMethod · 0.95
handleReparentMethod · 0.95

Calls 3

NewJSONIOFunction · 0.92
NewLegacyIOFunction · 0.92
DeserializeMethod · 0.65

Tested by

no test coverage detected