MCPcopy Create free account
hub / github.com/cli/cli / readLog

Function readLog

script/api-host-gateway/gateway/main_test.go:134–150  ·  view source on GitHub ↗
(t *testing.T, path string)

Source from the content-addressed store, hash-verified

132}
133
134func readLog(t *testing.T, path string) []record {
135 t.Helper()
136
137 contents, err := os.ReadFile(path)
138 require.NoError(t, err)
139
140 var entries []record
141 for line := range strings.SplitSeq(strings.TrimSpace(string(contents)), "\n") {
142 if line == "" {
143 continue
144 }
145 var entry record
146 require.NoError(t, json.Unmarshal([]byte(line), &entry))
147 entries = append(entries, entry)
148 }
149 return entries
150}

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected