MCPcopy Create free account
hub / github.com/assetnote/hyoketsu / streamJSONLFile

Function streamJSONLFile

cmd/importcmd.go:144–159  ·  view source on GitHub ↗
(path string, fn func(db.DLLMatch))

Source from the content-addressed store, hash-verified

142}
143
144func streamJSONLFile(path string, fn func(db.DLLMatch)) error {
145 f, err := os.Open(path)
146 if err != nil {
147 return err
148 }
149 defer f.Close()
150 dec := json.NewDecoder(f)
151 for dec.More() {
152 var e db.DLLMatch
153 if err := dec.Decode(&e); err != nil {
154 break
155 }
156 fn(e)
157 }
158 return nil
159}

Callers 4

TestStreamJSONLFileFunction · 0.85
TestStreamJSONLFileEmptyFunction · 0.85
runNugetImportFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by 3

TestStreamJSONLFileFunction · 0.68
TestStreamJSONLFileEmptyFunction · 0.68