MCPcopy Create free account
hub / github.com/blues/note / Create

Method Create

lib/fileio.go:42–50  ·  view source on GitHub ↗
(ctx context.Context, path string)

Source from the content-addressed store, hash-verified

40}
41
42func (fio *filesystem) Create(ctx context.Context, path string) (err error) {
43 str := strings.Split(path, "/")
44 if len(str) > 1 {
45 folder := strings.Join(str[0:len(str)-1], "/")
46 _ = os.MkdirAll(folder, 0o777)
47 }
48
49 return fio.WriteJSON(ctx, path, []byte("{}"))
50}
51
52func (fio *filesystem) Delete(ctx context.Context, path string) (err error) {
53 return os.Remove(path)

Callers

nothing calls this directly

Calls 1

WriteJSONMethod · 0.95

Tested by

no test coverage detected