MCPcopy Create free account
hub / github.com/ethstorage/es-node / readTxt

Function readTxt

cmd/es-utils/utils/utils_test.go:39–52  ·  view source on GitHub ↗
(t *testing.T, n int)

Source from the content-addressed store, hash-verified

37}
38
39func readTxt(t *testing.T, n int) []byte {
40 f, err := os.Open("../blob_8k.dat")
41 if err != nil {
42 t.Fatal("read file error")
43 }
44 defer f.Close()
45
46 data := make([]byte, 1024)
47 _, err = f.Read(data)
48 if err != nil {
49 t.Fatal("read txt error")
50 }
51 return data[:n]
52}

Callers

nothing calls this directly

Calls 2

CloseMethod · 0.65
ReadMethod · 0.65

Tested by

no test coverage detected