ReadFile reads and returns the contents of a file in tests.
(t *testing.T, path string)
| 39 | |
| 40 | // ReadFile reads and returns the contents of a file in tests. |
| 41 | func 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 | } |
no outgoing calls