MCPcopy
hub / github.com/dnote/dnote / ReadFile

Function ReadFile

pkg/cli/testutils/main.go:100–109  ·  view source on GitHub ↗

ReadFile reads the content of the file with the given name in dnote dir

(ctx context.DnoteCtx, filename string)

Source from the content-addressed store, hash-verified

98
99// ReadFile reads the content of the file with the given name in dnote dir
100func ReadFile(ctx context.DnoteCtx, filename string) []byte {
101 path := filepath.Join(ctx.Paths.LegacyDnote, filename)
102
103 b, err := os.ReadFile(path)
104 if err != nil {
105 panic(err)
106 }
107
108 return b
109}
110
111// ReadJSON reads JSON fixture to the struct at the destination address
112func ReadJSON(path string, destination interface{}) {

Callers 6

TestMigrateToV2Function · 0.92
TestMigrateToV3Function · 0.92
TestMigrateToV4Function · 0.92
TestMigrateToV5Function · 0.92
TestMigrateToV6Function · 0.92
TestMigrateToV7Function · 0.92

Calls

no outgoing calls

Tested by 6

TestMigrateToV2Function · 0.74
TestMigrateToV3Function · 0.74
TestMigrateToV4Function · 0.74
TestMigrateToV5Function · 0.74
TestMigrateToV6Function · 0.74
TestMigrateToV7Function · 0.74