MCPcopy Create free account
hub / github.com/Driver-C/tryssh / ReadFile

Function ReadFile

testutil/helpers.go:41–48  ·  view source on GitHub ↗

ReadFile reads and returns the contents of a file in tests.

(t *testing.T, path string)

Source from the content-addressed store, hash-verified

39
40// ReadFile reads and returns the contents of a file in tests.
41func ReadFile(t *testing.T, path string) string {
42 t.Helper()
43 data, err := os.ReadFile(path)
44 if err != nil {
45 t.Fatalf("Failed to read file %s: %v", path, err)
46 }
47 return string(data)
48}

Callers 4

TestCreateTestConfigFileFunction · 0.70
TestCreateTestKnownHostsFunction · 0.70
TestReadFileFunction · 0.70

Calls

no outgoing calls

Tested by 4

TestCreateTestConfigFileFunction · 0.56
TestCreateTestKnownHostsFunction · 0.56
TestReadFileFunction · 0.56