MCPcopy
hub / github.com/moonD4rk/HackBrowserData / readCSV

Function readCSV

output/output_test.go:296–309  ·  view source on GitHub ↗

--- helpers ---

(t *testing.T, path string)

Source from the content-addressed store, hash-verified

294// --- helpers ---
295
296func readCSV(t *testing.T, path string) [][]string {
297 t.Helper()
298 raw, err := os.ReadFile(path)
299 require.NoError(t, err)
300 // Skip UTF-8 BOM if present
301 content := string(raw)
302 if strings.HasPrefix(content, string(utf8BOM)) {
303 content = content[len(utf8BOM):]
304 }
305 reader := csv.NewReader(strings.NewReader(content))
306 records, err := reader.ReadAll()
307 require.NoError(t, err)
308 return records
309}
310
311func readJSON(t *testing.T, path string, v any) {
312 t.Helper()

Callers 3

TestWrite_CSV_PasswordFunction · 0.85
TestWrite_CSV_CookieFunction · 0.85
TestWrite_CSV_HistoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected