MCPcopy
hub / github.com/PeerDB-io/peerdb / ReadFileToBytes

Function ReadFileToBytes

flow/e2eshared/e2eshared.go:70–78  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

68}
69
70func ReadFileToBytes(path string) ([]byte, error) {
71 f, err := os.Open(path)
72 if err != nil {
73 return nil, fmt.Errorf("failed to open file: %w", err)
74 }
75 defer f.Close()
76
77 return io.ReadAll(f)
78}
79
80// checks if two QRecords are identical
81func CheckQRecordEquality(t *testing.T, q []types.QValue, other []types.QValue) bool {

Callers 1

Calls 1

CloseMethod · 0.65

Tested by 1